|
@@ -438,6 +438,9 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
|
|
|
|
|
|
//人脉库-列表
|
|
//人脉库-列表
|
|
func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
|
|
+ if in.Page_size <= 0 {
|
|
|
|
+ in.Page_size = 10
|
|
|
|
+ }
|
|
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=2,b.relate_id,NULL)) AS relate_project_id,a.create_time from crm.connection a
|
|
left join crm.connection_introduce b on (a.id=b.connection_id) where a.position_id=?`
|
|
left join crm.connection_introduce b on (a.id=b.connection_id) where a.position_id=?`
|
|
args := []interface{}{in.PositionId}
|
|
args := []interface{}{in.PositionId}
|
|
@@ -463,6 +466,10 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
args = append(args, "%"+in.Name+"%")
|
|
args = append(args, "%"+in.Name+"%")
|
|
}
|
|
}
|
|
q += ` GROUP BY a.id order by a.create_time desc`
|
|
q += ` GROUP BY a.id order by a.create_time desc`
|
|
|
|
+ if in.Buyercount_start == 0 && in.Buyercount_end == 0 && in.Monitor == 0 && in.Monitorcount_start == 0 && in.Monitorcount_end == 0 && in.Project_matchme == 0 {
|
|
|
|
+ q += ` limit ?`
|
|
|
|
+ args = append(args, in.Page_size)
|
|
|
|
+ }
|
|
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{}
|
|
for _, v := range *listTemp {
|
|
for _, v := range *listTemp {
|
|
@@ -650,9 +657,6 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
|
|
sort.Sort(csList)
|
|
sort.Sort(csList)
|
|
}
|
|
}
|
|
length := int64(len(csList.List))
|
|
length := int64(len(csList.List))
|
|
- if in.Page_size <= 0 {
|
|
|
|
- in.Page_size = 10
|
|
|
|
- }
|
|
|
|
total_page := int64(math.Ceil(float64(length) / float64(in.Page_size)))
|
|
total_page := int64(math.Ceil(float64(length) / float64(in.Page_size)))
|
|
finalList := []*map[string]interface{}{}
|
|
finalList := []*map[string]interface{}{}
|
|
if length > 0 {
|
|
if length > 0 {
|