WH01243 10 сар өмнө
parent
commit
6e95c1c07b

+ 0 - 3
clueSync/everything.go

@@ -907,13 +907,10 @@ func eventReg() {
 			if !ok1 {
 				common.WriteSysConfig(&cfg)
 				log.Println("线索卡点", "eventReg", v, lastEventRegTime)
-				break
 			} else {
 				if !ok2 {
 					log.Println("用户分配已达上限", "eventReg", v, lastEventRegTime)
-
 					common.WriteSysConfig(&cfg)
-					break
 				}
 			}
 			cfg.LastEventRegTime = common.ObjToString(v["update_time"])

+ 20 - 22
clueSync/jobutil.go

@@ -508,12 +508,10 @@ func orders() {
 				if !ok1 {
 					common.WriteSysConfig(&cfg)
 					log.Println("线索卡点", "orders", v, selectTimeEnd, selectTimeStart)
-					break
 				} else {
 					if !ok2 {
 						log.Println("用户分配已达上限", "orders", v, selectTimeEnd, selectTimeStart)
 						common.WriteSysConfig(&cfg)
-						break
 					}
 				}
 			}
@@ -535,12 +533,10 @@ func readClue() {
 			if !ok1 {
 				common.WriteSysConfig(&cfg)
 				log.Println("线索卡点", "readClue", v, lastReadClueTime)
-				break
 			} else {
 				if !ok2 {
 					log.Println("用户分配已达上限", "readClue", v, lastReadClueTime)
 					common.WriteSysConfig(&cfg)
-					break
 				}
 			}
 			cfg.LastReadClueTime = common.ObjToString(v["updatetime"])
@@ -566,21 +562,7 @@ func users() {
 	if data != nil && *data != nil && len(*data) > 0 {
 		for k, v := range *data {
 			//判断用户是否有小程序切使用过剑鱼其他产品
-			/*	s_platform := gconv.String(v["s_platform"])
-				login_positionid := gconv.Int64(v["login_positionid"])*/
 			createtime := common.ObjToString(v["createtime"])
-			/*if s_platform == "xcx" && login_positionid == 0 {
-				log.Println(v, "用户是否有小程序且未使用过剑鱼其他产品")
-			} else {
-				ok1, ok2 := FormatData(v, "users")
-				if !ok1 {
-					log.Println("线索卡点", "users", v, selectTimeEnd)
-				} else {
-					if !ok2 {
-						log.Println("用户分配已达上限", "users", v, selectTimeEnd)
-					}
-				}
-			}*/
 			ok1, ok2 := FormatData(v, "users")
 			if !ok1 {
 				log.Println("线索卡点", "users", v, selectTimeEnd)
@@ -634,17 +616,35 @@ WHERE
 	if xcxData != nil && *xcxData != nil && len(*xcxData) > 0 {
 		for k, v := range *xcxData {
 			//判断用户是否有小程序切使用过剑鱼其他产品
+			//判断uid
+			uId := ""
+			for i := 0; i < 10; i++ {
+				phone := common.ObjToString(v["phone"])
+				contactsData := TiDb.SelectBySql("select * from dwd_f_userbase_contacts where phone = ? and is_delete = 1", phone)
+				if contactsData != nil && len(*contactsData) > 0 {
+					if common.ObjToString((*contactsData)[0]["baseinfo_id"]) != "" {
+						uId = common.ObjToString((*contactsData)[0]["baseinfo_id"])
+					}
+				}
+				if uId == "" {
+					time.Sleep(1 * time.Minute)
+				} else {
+					break
+				}
+			}
 			updatetime := common.ObjToString(v["time"])
+			if uId == "" {
+				cfg.LastXcxUserId = updatetime
+				continue
+			}
 			ok1, ok2 := FormatData(v, "xcxusers")
 			if !ok1 {
 				common.WriteSysConfig(&cfg)
 				log.Println("小程序用户分配线索卡点", "xcxusers", v, selectXcxTimeEnd)
-				break
 			} else {
 				if !ok2 {
 					log.Println("小程序用户分配已达上限", "xcxusers", v, selectXcxTimeEnd)
 					common.WriteSysConfig(&cfg)
-					break
 				}
 			}
 
@@ -840,12 +840,10 @@ func userbase() {
 								if !ok1 {
 									common.WriteSysConfig(&cfg)
 									log.Println("线索卡点", "userbase uid", v, uId)
-									break
 								} else {
 									if !ok2 {
 										log.Println("用户分配已达上限", "userbase uid", v, uId)
 										common.WriteSysConfig(&cfg)
-										break
 									}
 								}
 							} else {

+ 0 - 2
clueSync/tag.go

@@ -324,11 +324,9 @@ func messageSync() {
 						ok1, ok2 := FormatData(*mData, "message")
 						if !ok1 {
 							log.Println("线索卡点", "message", mData, messag_id)
-							break
 						} else {
 							if !ok2 {
 								log.Println("用户分配已达上限", "message", mData, messag_id)
-								break
 							}
 						}
 					}