WH01243 1 жил өмнө
parent
commit
768a119a24
1 өөрчлөгдсөн 3 нэмэгдсэн , 6 устгасан
  1. 3 6
      service/clue.go

+ 3 - 6
service/clue.go

@@ -591,8 +591,7 @@ func DrawClues(positionId, count1, count2, count3 int64) int {
 		counts, counts1 := 0, 0
 		for {
 			logx.Info("等级1线索领取", count1, counts1, counts)
-			data := JyBiTidb.SelectBySql(`SELECT max(c.createTime) as ctime,a.id,a.trailstatus,a.cluename FROM dwd_f_crm_clue_info a 
-					LEFT JOIN Call_Accounting.voice_record c ON c.CalledNo = a.phone
+			data := JyBiTidb.SelectBySql(`SELECT a.last_ring_time as ctime,a.id,a.trailstatus,a.cluename FROM dwd_f_crm_clue_info a 
 					WHERE a.level_open = 1 AND a.is_assign = 0 AND a.uid !="" AND a.is_transfer != 1 GROUP BY a.id ORDER BY ctime asc limit ?,1`, counts1)
 			counts1++
 			if data != nil && len(*data) > 0 {
@@ -616,8 +615,7 @@ func DrawClues(positionId, count1, count2, count3 int64) int {
 		counts, counts1 := 0, 0
 		for {
 			logx.Info("等级2线索领取", count2, counts1, counts)
-			data := JyBiTidb.SelectBySql(`SELECT max(c.createTime) as ctime,a.id,a.trailstatus,a.cluename FROM dwd_f_crm_clue_info a 
-					LEFT JOIN Call_Accounting.voice_record c ON c.CalledNo = a.phone
+			data := JyBiTidb.SelectBySql(`SELECT a.last_ring_time as ctime,a.id,a.trailstatus,a.cluename FROM dwd_f_crm_clue_info a 
 					WHERE a.level_open = 2 AND a.is_assign = 0 AND a.uid !="" AND a.is_transfer != 1 GROUP BY a.id ORDER BY ctime asc limit ?,1`, counts1)
 			counts1++
 			if data != nil && len(*data) > 0 {
@@ -641,8 +639,7 @@ func DrawClues(positionId, count1, count2, count3 int64) int {
 		counts, counts1 := 0, 0
 		for {
 			logx.Info("等级3线索领取", count3, counts1, counts)
-			data := JyBiTidb.SelectBySql(`SELECT max(c.createTime) as ctime,a.id,a.trailstatus,a.cluename FROM dwd_f_crm_clue_info a 
-					LEFT JOIN Call_Accounting.voice_record c ON c.CalledNo = a.phone
+			data := JyBiTidb.SelectBySql(`SELECT a.last_ring_time as ctime,a.id,a.trailstatus,a.cluename FROM dwd_f_crm_clue_info a 
 					WHERE a.level_open = 3 AND a.is_assign = 0 AND a.uid !="" AND a.is_transfer != 1 GROUP BY a.id ORDER BY ctime asc limit ?,1`, counts1)
 			counts1++
 			if data != nil && len(*data) > 0 {