jiaojiao7 4 ani în urmă
părinte
comite
2bcd7cc86a
3 a modificat fișierele cu 5 adăugiri și 4 ștergeri
  1. 3 0
      customerdata/src/task.go
  2. 2 2
      src/history/task.go
  3. 0 2
      src/history/util_history.go

+ 3 - 0
customerdata/src/task.go

@@ -321,6 +321,9 @@ func (c *Customer) GetData(stype string) {
 										}
 									}
 								}
+								if len(sr.AW) == 0 {
+									IsMatch = true
+								}
 								/*
 									到此已经匹配完数据
 								*/

+ 2 - 2
src/history/task.go

@@ -246,14 +246,14 @@ func (c *Customer) GetData(stype string) {
 								for i, aw := range sr.AW {
 									// qu.Debug("-------------------------开始附加词匹配--------------------------")
 									IsMatchAddKey := RegMatch(fieldText, aw.MatchType, aw.KeyReg, nil, nil, false, true)
-									qu.Debug(IsMatchAddKey, id, "IsMatchAddKey------------------------------------------------------------")
+									// qu.Debug(IsMatchAddKey, "------------------------------------------------------------")
 
 									//2.关键词匹配
 									if IsMatchAddKey {
 										kw := sr.KW[i]
 										// qu.Debug("-------------------------开始关键词匹配--------------------------")
 										IsMatchKey := RegMatch(fieldText, kw.MatchType, kw.KeyReg, matchKey, matchKeyType, true, false)
-										qu.Debug(IsMatchKey, id, "IsMatchKey------------------------------------------------------------")
+										// qu.Debug(IsMatchKey, "------------------------------------------------------------")
 										if IsMatchKey {
 											IsMatch = true
 										}

+ 0 - 2
src/history/util_history.go

@@ -309,13 +309,11 @@ func CheckLetter(text string, reg *regexp.Regexp, indexArr [][]int) (flag bool)
 //匹配
 func RegMatch(fieldText map[string]interface{}, matchType []string, matchReg *Reg, matchKey map[string]bool, matchKeyType map[string]bool, goon, isAddWord bool) (match bool) {
 	defer qu.Catch()
-	fmt.Println("*************", fieldText, matchType, matchReg, matchKey, matchKeyType, goon, isAddWord)
 	if len(matchType) == 0 && isAddWord { //特殊处理附加词为空的情况
 		match = true
 		return
 	}
 	for _, mt := range matchType {
-
 		if text := qu.ObjToString(fieldText[mt]); text != "" {
 			for _, cr := range matchReg.CReg { //逗号分隔,任意一个匹配表示匹配成功
 				if goon && matchKey[cr.CsVal] { //matchkey已存在不在匹配