Эх сурвалжийг харах

Merge branch 'dev_v1.5.35_wh' of jianyu/datatools into feature/v1.5.35

王浩 2 сар өмнө
parent
commit
1ca7dd0492
1 өөрчлөгдсөн 9 нэмэгдсэн , 4 устгасан
  1. 9 4
      clueSync/tag.go

+ 9 - 4
clueSync/tag.go

@@ -160,7 +160,11 @@ func FormatTag(data map[string]interface{}, count int) {
 	keyStr := ""
 	phoneRegexp := regexp.MustCompile(`^1[0-9]{10}$`)
 	keyMap := map[string]bool{}
-	match := "会员,费,数据,价格,合作,大会员,超级订阅,功能,账号,如何,订阅,充值,试用,报价,买,意向,超前项目,附件,拟招标,个人办,vip,套餐,权益"
+	//match := "会员,费,数据,价格,合作,大会员,超级订阅,功能,账号,如何,订阅,充值,试用,报价,买,意向,超前项目,附件,拟招标,个人办,vip,套餐,权益"
+	matchArr := Base.Find("socialize_keyword", map[string]interface{}{
+		"mold":  0,
+		"state": 0,
+	}, "name", "", -1, -1)
 	sqls := fmt.Sprintf(`select b.content from socialize_message_mailbox a LEFT JOIN socialize_message b on b.id = a.messag_id where a.type in (4,5,7) and a.own_type = 2 and a.own_id = %d and b.title = "文本" and a.send_user_type = 2 and a.create_time >= "%s"`, base_user_id, time.Now().AddDate(0, 0, -30).Format("2006-01-02 15:04:05"))
 	mData := Base.SelectBySql(sqls)
 	if mData != nil && *mData != nil && len(*mData) > 0 {
@@ -169,9 +173,10 @@ func FormatTag(data map[string]interface{}, count int) {
 			if phoneRegexp.MatchString(content) {
 				keyMap[content] = true
 			}
-			for _, vvv := range strings.Split(match, ",") {
-				if strings.Contains(strings.ToUpper(content), strings.ToUpper(vvv)) {
-					keyMap[vvv] = true
+			for _, vvv := range *matchArr {
+				key := gconv.String(vvv["name"])
+				if strings.Contains(strings.ToUpper(content), strings.ToUpper(key)) {
+					keyMap[key] = true
 					break
 				}
 			}