|
@@ -97,6 +97,7 @@ type myNetwork struct {
|
|
Buyer_count int64
|
|
Buyer_count int64
|
|
Project_count int64
|
|
Project_count int64
|
|
Relate_buyer_id string
|
|
Relate_buyer_id string
|
|
|
|
+ Relate_buyer_name string
|
|
Relate_project_id string
|
|
Relate_project_id string
|
|
Create_time string
|
|
Create_time string
|
|
}
|
|
}
|
|
@@ -612,8 +613,8 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
jump_type = "middleman"
|
|
jump_type = "middleman"
|
|
jump_id = fmt.Sprint(v.Id)
|
|
jump_id = fmt.Sprint(v.Id)
|
|
buyer_count = v.Buyer_count
|
|
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 == "" {
|
|
if v == "" {
|
|
continue
|
|
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 {
|
|
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
|
|
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...)
|
|
listTemp := CrmMysql.SelectBySql(q, args...)
|
|
firstparty_array, supplier_array, adiffb_array, agency_array, middleman_project_array := []string{}, []string{}, []string{}, []string{}, []string{}
|
|
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"]),
|
|
Buyer_count: Int64All(v["buyer_count"]),
|
|
Project_count: Int64All(v["project_count"]),
|
|
Project_count: Int64All(v["project_count"]),
|
|
Relate_buyer_id: ObjToString(v["relate_buyer_id"]),
|
|
Relate_buyer_id: ObjToString(v["relate_buyer_id"]),
|
|
|
|
+ Relate_buyer_name: ObjToString(v["relate_buyer_name"]),
|
|
Relate_project_id: ObjToString(v["relate_project_id"]),
|
|
Relate_project_id: ObjToString(v["relate_project_id"]),
|
|
Create_time: ObjToString(v["create_time"]),
|
|
Create_time: ObjToString(v["create_time"]),
|
|
}
|
|
}
|