Browse Source

fix:公司联想优化

xuemingyang 3 years ago
parent
commit
596d8980b9
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/jfw/modules/subscribepay/src/service/userAccountInfo.go

+ 6 - 1
src/jfw/modules/subscribepay/src/service/userAccountInfo.go

@@ -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, config.Config.CompanySize)
+			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 {