Browse Source

fix:一个项目只选取一条公告联系人

wangkaiyue 3 years ago
parent
commit
90f0be5ad2
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/jfw/modules/bigmember/src/entity/portraitWinnerSearch.go

+ 6 - 0
src/jfw/modules/bigmember/src/entity/portraitWinnerSearch.go

@@ -77,12 +77,15 @@ func GetProjectContactsMsg(buyerName, entId string) (list []map[string]interface
 			if thisPerson == "" || thisPhone == "" { //联系人为空则不展示
 				continue
 			}
+			//一个项目只选取一条公告联系人
+			thisAddPerson := false
 			//名字中多个联系人拆分
 			for _, name := range strings.Split(thisPerson, ",") {
 				thisName := strings.TrimSpace(name)
 				if thisName == "" { //联系人为空则不展示
 					continue
 				}
+				thisAddPerson = true
 				repeatKey := fmt.Sprintf("%s_%s", thisName, thisPhone)
 				if repeatContacts[repeatKey] {
 					continue
@@ -96,6 +99,9 @@ func GetProjectContactsMsg(buyerName, entId string) (list []map[string]interface
 					"projectname": qutil.If(rowData["projectname"] != nil, rowData["projectname"], thisMsg["title"]),
 				})
 			}
+			if thisAddPerson {
+				break
+			}
 		}
 	}
 	return