|
@@ -592,7 +592,7 @@ func users() {
|
|
|
}
|
|
|
common.WriteSysConfig(&cfg)
|
|
|
selectXcxTimeEnd := cfg.LastXcxUserId
|
|
|
- xcxSql := fmt.Sprintf(`select * from dwd_f_userbase_baseinfo where s_platform ="xcx" and updatetime> "%s" and source = "0101" and status != 2`, selectXcxTimeEnd)
|
|
|
+ xcxSql := fmt.Sprintf(`select * from dwd_f_userbase_baseinfo where s_platform ="xcx" and updatetime> "%s" and source = "0101" and status != 2 and clue_operate_status!=1`, selectXcxTimeEnd)
|
|
|
xcxData := TiDb.SelectBySql(xcxSql)
|
|
|
if xcxData != nil && *xcxData != nil && len(*xcxData) > 0 {
|
|
|
for k, v := range *xcxData {
|
|
@@ -603,31 +603,30 @@ func users() {
|
|
|
log.Println(gconv.String(v["id"]), "用户是否有小程序且未使用过剑鱼其他产品")
|
|
|
continue
|
|
|
}
|
|
|
- //判断线索是否存在
|
|
|
- uid := gconv.String(v["uid"])
|
|
|
- if count := TiDb.CountBySql("dwd_f_crm_clue_info", map[string]interface{}{"uid": uid}, "", ""); count > 0 {
|
|
|
- log.Println(gconv.String(v["id"]), "小程序用户线索已存在", uid, count)
|
|
|
- continue
|
|
|
- }
|
|
|
updatetime := common.ObjToString(v["updatetime"])
|
|
|
- ok1, ok2 := FormatData(v, "users")
|
|
|
+ ok1, ok2 := FormatData(v, "xcxusers")
|
|
|
if !ok1 {
|
|
|
common.WriteSysConfig(&cfg)
|
|
|
- log.Println("小程序用户分配线索卡点", "users", v, selectTimeEnd)
|
|
|
+ log.Println("小程序用户分配线索卡点", "xcxusers", v, selectXcxTimeEnd)
|
|
|
break
|
|
|
} else {
|
|
|
if !ok2 {
|
|
|
- log.Println("小程序用户分配已达上限", "users", v, selectTimeEnd)
|
|
|
+ log.Println("小程序用户分配已达上限", "xcxusers", v, selectXcxTimeEnd)
|
|
|
common.WriteSysConfig(&cfg)
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- if k == len(*data)-1 {
|
|
|
+ TiDb.Update("dwd_f_userbase_baseinfo", map[string]interface{}{
|
|
|
+ "id": gconv.Int64(v["id"]),
|
|
|
+ }, map[string]interface{}{
|
|
|
+ "clue_operate_status": 1,
|
|
|
+ })
|
|
|
+ if k == len(*xcxData)-1 {
|
|
|
cfg.LastXcxUserId = updatetime
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ common.WriteSysConfig(&cfg)
|
|
|
log.Println("新注册用户定时任务结束")
|
|
|
}
|
|
|
|
|
@@ -940,6 +939,21 @@ func getClueType(item string, data map[string]interface{}, sourceCode string, so
|
|
|
code = "618"
|
|
|
subname = "7天后到期"
|
|
|
}
|
|
|
+ } else if item == "xcxusers" {
|
|
|
+ level = "C"
|
|
|
+ if sourceCode != "" {
|
|
|
+ codeData := TiDb.FindOne("dwd_d_crm_cluetype_code", map[string]interface{}{"source": sourceCode}, "", "")
|
|
|
+ if codeData != nil && len(*codeData) > 0 {
|
|
|
+ pcode = common.ObjToString((*codeData)["pcode"])
|
|
|
+ code = common.ObjToString((*codeData)["code"])
|
|
|
+ level = common.ObjToString((*codeData)["clue_level"])
|
|
|
+ subname = common.ObjToString((*codeData)["name"])
|
|
|
+ pcodeData := TiDb.FindOne("dwd_d_crm_cluetype_code", map[string]interface{}{"code": pcode}, "", "")
|
|
|
+ if pcodeData != nil && len(*pcodeData) > 0 {
|
|
|
+ topname = common.ObjToString((*pcodeData)["name"])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
if sourceCode != "" {
|
|
|
codeData := TiDb.FindOne("dwd_d_crm_cluetype_code", map[string]interface{}{"source": sourceCode}, "", "")
|
|
@@ -969,8 +983,6 @@ func autoDraw(mode, cluename, phone string, isGroup, isCommerce int) (positionId
|
|
|
isOk = true
|
|
|
positionId = common.Int64All((*cdata)["position_id"])
|
|
|
noticePositionId = positionId
|
|
|
- seatNumber = common.ObjToString((*cdata)["seatNumber"])
|
|
|
- log.Println("positionId seatNumber ", positionId, seatNumber)
|
|
|
if positionId > 0 {
|
|
|
pdata := TiDb.SelectBySql(`select * from dwd_f_crm_personnel_management where seat_number is not null and seat_number != ""`)
|
|
|
if pdata != nil {
|
|
@@ -1013,6 +1025,9 @@ func autoDraw(mode, cluename, phone string, isGroup, isCommerce int) (positionId
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ seatNumber = common.ObjToString((*cdata)["seatNumber"])
|
|
|
+ log.Println("positionId seatNumber ", positionId, seatNumber)
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
query := `select * from dwd_f_crm_personnel_management where assign_type = 1 and`
|