|
@@ -396,7 +396,7 @@ func ThreeOpenSea(oneA, oneB, oneC, twoA, twoB, twoC, twoD map[string]bool) map[
|
|
|
wh := strings.Join(whs, ",")
|
|
|
config.JianyuSubjectdb.UpdateOrDeleteBySql(`UPDATE dwd_f_crm_clue_info SET level_open = 3,clue_level='D' WHERE id in (`+wh+`)`, ids...)
|
|
|
return true
|
|
|
- }, `SELECT id,userid FROM dwd_f_crm_clue_info`)
|
|
|
+ }, `SELECT id,userid FROM dwd_f_crm_clue_info where is_assign = 0`)
|
|
|
log.Println("三级公海end")
|
|
|
return m
|
|
|
}
|
|
@@ -431,25 +431,25 @@ func AddOpenSea(m map[string]bool, level int, clue_level string) {
|
|
|
// 自动退出公海
|
|
|
// 线索状态为“空号停机”自动从线索池删除。
|
|
|
// 空号停机 删除私海, 线索表分配状态改成 -1
|
|
|
-func DeleteOpenSea() {
|
|
|
- config.JianyuSubjectdb.SelectByBath(500, func(l *[]map[string]interface{}) bool {
|
|
|
- ids := []interface{}{}
|
|
|
- for _, v := range *l {
|
|
|
- id := v["id"]
|
|
|
- ids = append(ids, id)
|
|
|
- }
|
|
|
- whs := []string{}
|
|
|
- for i := 0; i < len(ids); i++ {
|
|
|
- whs = append(whs, "?")
|
|
|
- }
|
|
|
- wh := strings.Join(whs, ",")
|
|
|
- count := config.JianyuSubjectdb.UpdateOrDeleteBySql(`UPDATE dwd_f_crm_clue_info SET is_assign = -1 WHERE id in (`+wh+`)`, ids...)
|
|
|
- if count > 0 {
|
|
|
- return true
|
|
|
- }
|
|
|
- return true
|
|
|
- }, `select id from dwd_f_crm_clue_info where trailstatus = ?`, "02")
|
|
|
-}
|
|
|
+// func DeleteOpenSea() {
|
|
|
+// config.JianyuSubjectdb.SelectByBath(500, func(l *[]map[string]interface{}) bool {
|
|
|
+// ids := []interface{}{}
|
|
|
+// for _, v := range *l {
|
|
|
+// id := v["id"]
|
|
|
+// ids = append(ids, id)
|
|
|
+// }
|
|
|
+// whs := []string{}
|
|
|
+// for i := 0; i < len(ids); i++ {
|
|
|
+// whs = append(whs, "?")
|
|
|
+// }
|
|
|
+// wh := strings.Join(whs, ",")
|
|
|
+// count := config.JianyuSubjectdb.UpdateOrDeleteBySql(`UPDATE dwd_f_crm_clue_info SET is_assign = -1 WHERE id in (`+wh+`)`, ids...)
|
|
|
+// if count > 0 {
|
|
|
+// return true
|
|
|
+// }
|
|
|
+// return true
|
|
|
+// }, `select id from dwd_f_crm_clue_info where trailstatus = ?`, "02")
|
|
|
+// }
|
|
|
|
|
|
//自动退回公海
|
|
|
/*
|
|
@@ -661,7 +661,7 @@ func GetOneSeaC(oneClassA, oneClassB map[string]bool) map[string]bool {
|
|
|
m[clueid] = true
|
|
|
}
|
|
|
return true
|
|
|
- }, `select id from dwd_f_crm_clue_info where comeinsource_open in(2,3,4)`)
|
|
|
+ }, `select id from dwd_f_crm_clue_info where is_assign = 0 and comeinsource_open in(2,3,4)`)
|
|
|
return m
|
|
|
}
|
|
|
|
|
@@ -697,7 +697,7 @@ func Recycle() {
|
|
|
recycleB := g.Cfg().MustGet(ctx, "recycleB").Int()
|
|
|
tB := t.AddDate(0, 0, -recycleB)
|
|
|
for sql, clue_level := range map[string]interface{}{
|
|
|
- fmt.Sprintf(`select id from dwd_f_crm_clue_info where comeinsource_open=%v and comeintime_open > "%s" ;`, 2, tA.Format(date.Date_Full_Layout)): "A",
|
|
|
+ fmt.Sprintf(`select id from dwd_f_crm_clue_info where comeinsource_open=%v and is_assign = 0 and comeintime_open > "%s" ;`, 2, tA.Format(date.Date_Full_Layout)): "A",
|
|
|
fmt.Sprintf(`SELECT a.uid,b.phone,c.createTime,a.id FROM dwd_f_crm_clue_info a
|
|
|
LEFT JOIN dwd_f_userbase_contacts b ON b.baseinfo_id=a.uid
|
|
|
LEFT JOIN Call_Accounting.voice_record c ON c.CalledNo = b.phone
|
|
@@ -716,7 +716,7 @@ func Recycle() {
|
|
|
whs = append(whs, "?")
|
|
|
}
|
|
|
wh := strings.Join(whs, ",")
|
|
|
- config.JianyuSubjectdb.UpdateOrDeleteBySql(`UPDATE dwd_f_crm_open_sea SET level = 4,clue_level = "`+fmt.Sprint(clue_level)+`" WHERE id in (`+wh+`)`, ids...)
|
|
|
+ config.JianyuSubjectdb.UpdateOrDeleteBySql(`UPDATE dwd_f_crm_clue_info SET level_open = 4,clue_level = "`+fmt.Sprint(clue_level)+`" WHERE id in (`+wh+`)`, ids...)
|
|
|
return true
|
|
|
}, sql)
|
|
|
}(sql)
|