wangchuanjin 1 жил өмнө
parent
commit
7fbc393335

+ 5 - 3
api/internal/service/network.go

@@ -97,6 +97,7 @@ type myNetwork struct {
 	Buyer_count       int64
 	Project_count     int64
 	Relate_buyer_id   string
+	Relate_buyer_name string
 	Relate_project_id string
 	Create_time       string
 }
@@ -612,8 +613,8 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 				jump_type = "middleman"
 				jump_id = fmt.Sprint(v.Id)
 				buyer_count = v.Buyer_count
-				if v.Relate_buyer_id != "" {
-					for _, v := range strings.Split(v.Relate_buyer_id, ",") {
+				if v.Relate_buyer_name != "" {
+					for _, v := range strings.Split(v.Relate_buyer_name, ",") {
 						if v == "" {
 							continue
 						}
@@ -1143,7 +1144,7 @@ func (n *network) MakeProjectInfo(buyers []string, vbs map[string][]*idName, pro
 
 //
 func (n *network) AllIntroduceOwner(sqlAppend1, sqlAppend2 string, args []interface{}, isTjProject bool, probusfors []string, entMonitor map[string]bool) *introduceOwnerProject {
-	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=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_project_array := []string{}, []string{}, []string{}, []string{}, []string{}
@@ -1160,6 +1161,7 @@ func (n *network) AllIntroduceOwner(sqlAppend1, sqlAppend2 string, args []interf
 			Buyer_count:       Int64All(v["buyer_count"]),
 			Project_count:     Int64All(v["project_count"]),
 			Relate_buyer_id:   ObjToString(v["relate_buyer_id"]),
+			Relate_buyer_name: ObjToString(v["relate_buyer_name"]),
 			Relate_project_id: ObjToString(v["relate_project_id"]),
 			Create_time:       ObjToString(v["create_time"]),
 		}

+ 2 - 2
go.mod

@@ -13,8 +13,10 @@ require (
 	github.com/ClickHouse/clickhouse-go/v2 v2.2.0
 	github.com/RoaringBitmap/roaring v1.5.0
 	github.com/gogf/gf/v2 v2.0.6
+	github.com/golang/protobuf v1.5.3
 	github.com/shopspring/decimal v1.3.1
 	github.com/zeromicro/go-zero v1.5.5
+	google.golang.org/grpc v1.57.0
 )
 
 require (
@@ -47,7 +49,6 @@ require (
 	github.com/gogo/protobuf v1.3.2 // indirect
 	github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
 	github.com/golang/mock v1.6.0 // indirect
-	github.com/golang/protobuf v1.5.3 // indirect
 	github.com/golang/snappy v0.0.4 // indirect
 	github.com/gomodule/redigo v2.0.0+incompatible // indirect
 	github.com/google/gnostic v0.5.7-v3refs // indirect
@@ -123,7 +124,6 @@ require (
 	google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
 	google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
 	google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
-	google.golang.org/grpc v1.57.0 // indirect
 	google.golang.org/protobuf v1.31.0 // indirect
 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect