|
@@ -78,10 +78,11 @@ func autoTask() {
|
|
|
args2 := []interface{}{clueId}
|
|
|
//获取跟进内容
|
|
|
// sql1 := `select COUNT(1) FROM dwd_f_crm_trail_content WHERE clue_id =?;`
|
|
|
- sql2 := `SELECT COUNT(1) FROM dwd_f_crm_trail_content WHERE clue_id =? `
|
|
|
+ sql2 := `SELECT COUNT(1) FROM dwd_f_crm_trail_content WHERE clue_id = ? and position_id = ?`
|
|
|
if intime != "" {
|
|
|
sql2 += ` and createtime > ?`
|
|
|
args2 = append(args2, intime)
|
|
|
+ args2 = append(args2, position_id)
|
|
|
}
|
|
|
//保留未跟进线索
|
|
|
// if c1, c2 := TiDb.CountBySql(sql1, clueId), TiDb.CountBySql(sql2, args2...); (c1 != 0 && c2 > 0) || out_task_status == 1 {
|