浏览代码

Merge branch 'feature/v4.7.20' of http://192.168.3.207:8080/qmx/jy into feature/v4.7.20

wangshan 3 年之前
父节点
当前提交
80fa5da395

+ 2 - 1
src/jfw/modules/subscribepay/src/config.json

@@ -111,5 +111,6 @@
 	"smsServiceRpc":"127.0.0.1:932",
 	"nsq":"192.168.3.240:4260",
   "nsq_topic": "jy_event",
-  "userCenterApi":"https://web-zxl.jydev.jianyu360.com"
+  "userCenterApi":"https://web-zxl.jydev.jianyu360.com",
+  "companySize": 10
 }

+ 1 - 0
src/jfw/modules/subscribepay/src/config/config.go

@@ -75,6 +75,7 @@ type config struct {
 	Nsq                string
 	Nsq_Topic          string
 	UserCenterApi      string
+	CompanySize        int64
 }
 type mgoConf struct {
 	Address           string

+ 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, 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 {