Browse Source

feat:xiugai

wangchuanjin 9 months ago
parent
commit
e79dd3c9d4
2 changed files with 2 additions and 2 deletions
  1. 1 1
      api/internal/service/network.go
  2. 1 1
      api/internal/service/plistService.go

+ 1 - 1
api/internal/service/network.go

@@ -1451,7 +1451,7 @@ func (n *network) MakeProjectInfo(agencyIds, winnerIds []string, vbs map[string]
 
 func (n *network) AllIntroduceOwner(positionId int64, sqlAppend1, sqlAppend2 string, args []interface{}, isTjProject bool, businessType []string) *introduceOwnerProject {
 	logx.Info(positionId, " AllIntroduceOwner start 。。。")
-	q := `select a.id,a.company_id,a.company_name,a.qyxy_id,a.itype,a.contact_person as person,a.contact_phone as phone,uniqCombined(if(b.itype=1,b.relate_id,null)) as buyer_count,uniqCombined(if(b.itype=2,b.relate_id,null)) as project_count,GROUP_CONCAT(IF(b.itype=1,b.relate_id,NULL)) AS relate_buyer_id,GROUP_CONCAT(IF(b.itype=1,b.relate_name,NULL)) AS relate_buyer_name,GROUP_CONCAT(IF(b.itype=2,b.relate_id,NULL)) AS relate_project_id,a.create_time from crm.connection a 
+	q := `select a.id,a.company_id,a.company_name,a.qyxy_id,a.itype,a.contact_person as person,a.contact_phone as phone,count(distinct if(b.itype=1,b.relate_id,null)) as buyer_count,count(distinct if(b.itype=2,b.relate_id,null)) as project_count,GROUP_CONCAT(IF(b.itype=1,b.relate_id,NULL)) AS relate_buyer_id,GROUP_CONCAT(IF(b.itype=1,b.relate_name,NULL)) AS relate_buyer_name,GROUP_CONCAT(IF(b.itype=2,b.relate_id,NULL)) AS relate_project_id,a.create_time from crm.connection a 
 		left join crm.connection_introduce b on (a.position_id=? and b.position_id=? and a.id=b.connection_id) where a.position_id=?` + sqlAppend1 + ` GROUP BY a.id order by a.create_time desc` + sqlAppend2
 	listTemp := CrmMysql.SelectBySql(q, args...)
 	firstparty_array, supplier_array, adiffb_array, agency_array, middleman_buyer_array, middleman_project_array := []string{}, []string{}, []string{}, []string{}, []string{}, []string{}

+ 1 - 1
api/internal/service/plistService.go

@@ -207,7 +207,7 @@ func getQuerySql(req *types.ProjectListReq, plist []string, businessStr string)
 		allArgs = append(allArgs, args...)
 	}
 	if len(ors2) > 0 {
-		ors1 = append(ors1, `(buyer_id in (select uniqCombined(buyer_id) from transaction_info_all prewhere (`+strings.Join(ors2, " or ")+`) and buyer_id<>'' and zbtime>?))`)
+		ors1 = append(ors1, `(buyer_id in (select distinct buyer_id from transaction_info_all prewhere (`+strings.Join(ors2, " or ")+`) and buyer_id<>'' and zbtime>?))`)
 		allArgs = append(allArgs, yearLimit)
 	}
 	allArgs = append(allArgs, yearLimit)