|
@@ -60,7 +60,9 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq) *biservice.Distri
|
|
|
pArr = append(pArr, strconv.FormatInt(c.PositionId, 10))
|
|
|
}
|
|
|
//
|
|
|
- sdata := JyBiTidb.SelectBySql(`SELECT b.cluename,b.position_id FROM dwd_f_crm_clue_info a INNER JOIN (SELECT cluename,position_id FROM dwd_f_crm_clue_info WHERE position_id in (` + strings.Join(pArr, ",") + `) GROUP BY cluename) AS b ON a.cluename = b.cluename WHERE id in (` + this.ClueIdList + `) GROUP BY cluename`)
|
|
|
+ sql1 := `SELECT b.cluename,b.position_id FROM dwd_f_crm_clue_info a INNER JOIN (SELECT cluename,position_id FROM dwd_f_crm_clue_info WHERE position_id in (` + strings.Join(pArr, ",") + `) GROUP BY cluename) AS b ON a.cluename = b.cluename WHERE id in (` + this.ClueIdList + `) GROUP BY cluename`
|
|
|
+ log.Println("sql1 ", sql1)
|
|
|
+ sdata := JyBiTidb.SelectBySql(sql1)
|
|
|
if sdata != nil && len(*sdata) > 0 {
|
|
|
for _, v := range *sdata {
|
|
|
sPositionId := common.Int64All(v["position_id"])
|
|
@@ -80,7 +82,9 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq) *biservice.Distri
|
|
|
}
|
|
|
//
|
|
|
clueArrs := []string{}
|
|
|
- ldata := JyBiTidb.SelectBySql(`SELECT b.id,b.position_id FROM dwd_f_crm_clue_info a INNER JOIN (SELECT id,cluename,position_id FROM dwd_f_crm_clue_info WHERE position_id in (` + strings.Join(pArr, ",") + `) GROUP BY cluename) AS b ON a.cluename = b.cluename WHERE a.id in (` + this.ClueIdList + `)`)
|
|
|
+ sql2 := `SELECT b.id,b.position_id FROM dwd_f_crm_clue_info a INNER JOIN (SELECT id,cluename,position_id FROM dwd_f_crm_clue_info WHERE position_id in (` + strings.Join(pArr, ",") + `) GROUP BY cluename) AS b ON a.cluename = b.cluename WHERE a.id in (` + this.ClueIdList + `)`
|
|
|
+ log.Println("sql2 ", sql2)
|
|
|
+ ldata := JyBiTidb.SelectBySql(sql2)
|
|
|
if ldata != nil && len(*ldata) > 0 {
|
|
|
clueArr := strings.Split(this.ClueIdList, ",")
|
|
|
wg := new(sync.WaitGroup)
|
|
@@ -114,7 +118,9 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq) *biservice.Distri
|
|
|
wg.Wait()
|
|
|
}
|
|
|
//
|
|
|
- cdata := JyBiTidb.SelectBySql(`SELECT cluename,COUNT(*) AS count FROM dwd_f_crm_clue_info WHERE id in (` + strings.Join(clueArrs, ",") + `) GROUP BY cluename ORDER BY count desc`)
|
|
|
+ sql3 := `SELECT cluename,COUNT(*) AS count FROM dwd_f_crm_clue_info WHERE id in (` + strings.Join(clueArrs, ",") + `) GROUP BY cluename ORDER BY count desc`
|
|
|
+ log.Println("sql3 ", sql3)
|
|
|
+ cdata := JyBiTidb.SelectBySql(sql3)
|
|
|
if cdata != nil && len(*cdata) > 0 {
|
|
|
for _, v := range *cdata {
|
|
|
count := common.IntAll(v["count"])
|