|
@@ -200,9 +200,14 @@ func (this *UserAccount) MailSet(doType string) {
|
|
|
func (this *UserAccount) CompanyAssociation() {
|
|
|
rData, errMsg := func() (interface{}, error) {
|
|
|
name := this.GetString("name")
|
|
|
+ companyCount, _ := this.GetInt("companyCount")
|
|
|
+ count := config.Config.CompanySize
|
|
|
+ if companyCount <= config.Config.CompanySize && companyCount != 0 {
|
|
|
+ count = companyCount
|
|
|
+ }
|
|
|
list := []string{}
|
|
|
if len([]rune(name)) > 2 {
|
|
|
- query := fmt.Sprintf(`{"query": {"match_phrase": {"name": "%s"}},"_source": ["name"],"size": %d}`, name, 5)
|
|
|
+ query := fmt.Sprintf(`{"query": {"match_phrase": {"name": "%s"}},"_source": ["name"],"size": %d}`, name, count)
|
|
|
r := elastic.Get("qyxy", "qyxy", query)
|
|
|
if r != nil {
|
|
|
for _, v := range *r {
|