浏览代码

Merge branch 'dev/v1.0.6' of BaseService/biService into feature/v1.0.6

xuzhiheng 2 年之前
父节点
当前提交
4f7ecfcc25
共有 1 个文件被更改,包括 22 次插入3 次删除
  1. 22 3
      service/clue.go

+ 22 - 3
service/clue.go

@@ -90,6 +90,9 @@ func DistributeClueMore(saleMap map[string]map[string]interface{}, distributedAr
 						"comeinsource_open":    nil,
 						"level_open":           nil,
 						"clue_level":           nil,
+						"out_task_time":        nil,
+						"out_task_status":      nil,
+						"trail_time":           nil,
 					}
 					ok := JyBiTidb.Update("dwd_f_crm_clue_info", map[string]interface{}{"id": v}, updateClue)
 					// ok := JyBiTidb.Update("dwd_f_crm_private_sea", map[string]interface{}{"clue_id": v}, map[string]interface{}{
@@ -148,6 +151,10 @@ func DistributeClueMore(saleMap map[string]map[string]interface{}, distributedAr
 						"comeinsource_open":    nil,
 						"level_open":           nil,
 						"clue_level":           nil,
+						"out_task_time":        nil,
+						"out_task_status":      nil,
+						"trail_time":           nil,
+						"next_trail_time":      nil,
 					}
 					if trailstatus != "08" {
 						updateClue["trailstatus"] = "01"
@@ -250,13 +257,25 @@ func DrawClueSync(this *biservice.DrawClueReq) (int, int) {
 func DrawClues(positionId, count1, count2, count3 int64) int {
 	data1, data2, data3, drawCount := &[]map[string]interface{}{}, &[]map[string]interface{}{}, &[]map[string]interface{}{}, 0
 	if count1 > 0 {
-		data1 = JyBiTidb.Find("dwd_f_crm_clue_info", map[string]interface{}{"level_open": 1, "is_assign": 0}, "", "", 0, int(count1))
+		// data1 = JyBiTidb.Find("dwd_f_crm_clue_info", map[string]interface{}{"level_open": 1, "is_assign": 0}, "", "", 0, int(count1))
+		data1 = JyBiTidb.SelectBySql(`SELECT a.* 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
+					WHERE a.level_open = ? AND a.is_assign = 0 AND a.uid !="" ORDER BY c.createTime asc limit ?`, 1, count1)
 	}
 	if count2 > 0 {
-		data2 = JyBiTidb.Find("dwd_f_crm_clue_info", map[string]interface{}{"level_open": 2, "is_assign": 0}, "", "", 0, int(count2))
+		// data2 = JyBiTidb.Find("dwd_f_crm_clue_info", map[string]interface{}{"level_open": 2, "is_assign": 0}, "", "", 0, int(count2))
+		data2 = JyBiTidb.SelectBySql(`SELECT a.* 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
+					WHERE a.level_open = ? AND a.is_assign = 0 AND a.uid !="" ORDER BY c.createTime asc limit ?`, 2, count2)
 	}
 	if count3 > 0 {
-		data3 = JyBiTidb.Find("dwd_f_crm_clue_info", map[string]interface{}{"level_open": 3, "is_assign": 0}, "", "", 0, int(count3))
+		// data3 = JyBiTidb.Find("dwd_f_crm_clue_info", map[string]interface{}{"level_open": 3, "is_assign": 0}, "", "", 0, int(count3))
+		data3 = JyBiTidb.SelectBySql(`SELECT a.* 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
+					WHERE a.level_open = ? AND a.is_assign = 0 AND a.uid !="" ORDER BY c.createTime asc limit ?`, 3, count3)
 	}
 	nowTime := time.Now().Format("2006-01-02 15:04:05")
 	seatNumber, name := getSeatNumber(positionId)