|
@@ -507,9 +507,8 @@ func autoDraw(mode, cluename, phone string, isGroup, isCommerce int) (positionId
|
|
for _, kv := range *data {
|
|
for _, kv := range *data {
|
|
positionId1 := gconv.String(kv["position_id"])
|
|
positionId1 := gconv.String(kv["position_id"])
|
|
if !FindUpperLimit(positionId1, "", false) {
|
|
if !FindUpperLimit(positionId1, "", false) {
|
|
|
|
+ positionId = common.Int64All(kv["position_id"])
|
|
saleName = common.ObjToString(kv["name"])
|
|
saleName = common.ObjToString(kv["name"])
|
|
- positionId = common.Int64All((*data)[0]["position_id"])
|
|
|
|
- saleName = common.ObjToString((*data)[0]["name"])
|
|
|
|
rData := TiDb.FindOne("dwd_f_crm_clue_autodraw_record", map[string]interface{}{"clue_level": mode}, "", "count desc")
|
|
rData := TiDb.FindOne("dwd_f_crm_clue_autodraw_record", map[string]interface{}{"clue_level": mode}, "", "count desc")
|
|
if rData != nil && len(*rData) > 0 {
|
|
if rData != nil && len(*rData) > 0 {
|
|
TiDb.Insert("dwd_f_crm_clue_autodraw_record", map[string]interface{}{
|
|
TiDb.Insert("dwd_f_crm_clue_autodraw_record", map[string]interface{}{
|
|
@@ -569,9 +568,9 @@ func FindUpperLimit(positionId string, level string, isAdd bool) bool {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
isFull := false
|
|
isFull := false
|
|
- fmt.Println("111", positionId, TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 `, positionId))
|
|
|
|
|
|
+ fmt.Println("111", positionId, TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 and trailstatus != '08' `, positionId))
|
|
isFull = TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 and trailstatus != '08' `, positionId) >= cfg.AllocationCap
|
|
isFull = TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 and trailstatus != '08' `, positionId) >= cfg.AllocationCap
|
|
-
|
|
|
|
|
|
+ fmt.Println("2222", TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 and trailstatus != '08' `, positionId), TiDb.CountBySql(`select count(1) from dwd_f_crm_clue_info where position_id=? and is_assign=1 and trailstatus != '08' `, positionId) >= cfg.AllocationCap)
|
|
if isFull && isAdd && level != "" {
|
|
if isFull && isAdd && level != "" {
|
|
TiDb.UpdateOrDeleteBySql(`update dwd_f_crm_clue_autodraw_record set count = count + 1 where position_id = ? and clue_level = ?`, positionId, level)
|
|
TiDb.UpdateOrDeleteBySql(`update dwd_f_crm_clue_autodraw_record set count = count + 1 where position_id = ? and clue_level = ?`, positionId, level)
|
|
}
|
|
}
|