xuzhiheng 5 gadi atpakaļ
vecāks
revīzija
f2ed3ca050
2 mainītis faili ar 5 papildinājumiem un 16 dzēšanām
  1. 5 15
      customerdata/src/task.go
  2. 0 1
      src/history/task.go

+ 5 - 15
customerdata/src/task.go

@@ -51,7 +51,7 @@ func GetCustomerData() {
 		appId := qu.ObjToString(c["s_appid"])     //appid
 		extends := qu.ObjToString(c["s_extends"]) //扩展信息
 		pushModel := qu.IntAll(c["i_pushmodel"])  //推送模式
-
+		log.Println("当前客户 ", customer)
 		cus := &Customer{}
 		cus.SaveDataMap = map[string]map[string]interface{}{}
 		cus.SaveDataArr = []map[string]interface{}{}
@@ -556,27 +556,17 @@ func (d *Department) GetSearchRules(cid, stype string, idRange bson.M) {
 			//获取关键词和附加词
 			if o_rules, ok := sr["o_rules"].(primitive.A); ok && len(o_rules) > 0 {
 				SR.GetKeyAddWord(o_rules)
-			}
-			//获取全局清理词
-			SR.GetClearWord(clearKey, clearKeyMatch)
-			d.Rules = append(d.Rules, SR)
-			//
-			if orules1, ok := sr["o_rules"].([]interface{}); ok {
-				for _, v := range orules1 {
+				for _, v := range o_rules {
 					orule, _ := v.(map[string]interface{})
 					SR.Maths = append(SR.Maths, map[string]string{
 						"s_matchkey": qu.ObjToString(orule["s_matchkey"]),
 						"s_keymatch": qu.ObjToString(orule["s_keymatch"]),
 					})
 				}
-			} else if orules2, ok := sr["o_rules"].([]map[string]interface{}); ok {
-				for _, v := range orules2 {
-					SR.Maths = append(SR.Maths, map[string]string{
-						"s_matchkey": qu.ObjToString(v["s_matchkey"]),
-						"s_keymatch": qu.ObjToString(v["s_keymatch"]),
-					})
-				}
 			}
+			//获取全局清理词
+			SR.GetClearWord(clearKey, clearKeyMatch)
+			d.Rules = append(d.Rules, SR)
 		}
 	}
 }

+ 0 - 1
src/history/task.go

@@ -262,7 +262,6 @@ func (c *Customer) GetData(stype string) {
 									// tmpMatchKey := MapDataToArr(matchKey)
 									tmpMatchKeyType := MapDataToArr(matchKeyType)
 									tmp["matchkey"] = GetMactchKeys(sr.Maths, tmp)
-									log.Println("matchkey", tmp["matchkey"])
 									tmp["matchtype"] = strings.Join(tmpMatchKeyType, ",")
 									tmp["ruleid"] = sr.ID
 									tmp["rulename"] = sr.Name