|
@@ -87,9 +87,17 @@ type ResultData struct {
|
|
|
data []map[string]interface{} `json:"data"`
|
|
|
}
|
|
|
|
|
|
+type ProjectTmp struct {
|
|
|
+ Buyer string `ch:"buyer"`
|
|
|
+ BuyerId string `ch:"buyer_id"`
|
|
|
+ Agency string `ch:"agency"`
|
|
|
+ AgencyId string `ch:"agency_id"`
|
|
|
+ PropertyForm []string `ch:"property_form"`
|
|
|
+}
|
|
|
+
|
|
|
func GetPrList(req *types.CoopHistoryReq) (result []*ResultData) {
|
|
|
- pMap := make(map[string]interface{})
|
|
|
- err := T.ClickhouseConn.QueryRow(context.TODO(), sql_2_0, req.Pid).Scan(&pMap)
|
|
|
+ pTmp := ProjectTmp{}
|
|
|
+ err := T.ClickhouseConn.QueryRow(context.TODO(), sql_2_0, req.Pid).ScanStruct(&pTmp)
|
|
|
if err != nil {
|
|
|
return nil
|
|
|
}
|
|
@@ -101,7 +109,7 @@ func GetPrList(req *types.CoopHistoryReq) (result []*ResultData) {
|
|
|
|
|
|
// 1、同甲异业数据/招标代理机构渠道
|
|
|
if propertyForm != "" {
|
|
|
- r1, r2 := GetData(propertyForm, common.ObjToString(pMap["buyer_id"]))
|
|
|
+ r1, r2 := GetData(propertyForm, pTmp.BuyerId)
|
|
|
if r1 != nil && len(r1) > 0 {
|
|
|
tmp := &ResultData{
|
|
|
channelType: 1,
|
|
@@ -122,19 +130,29 @@ func GetPrList(req *types.CoopHistoryReq) (result []*ResultData) {
|
|
|
}
|
|
|
}
|
|
|
// 中间人可介绍业主
|
|
|
- r3 := GetData1(req.PositionId, common.ObjToString(pMap["buyer_id"]))
|
|
|
- if r3 != nil && len(r3) > 0 {
|
|
|
- tmp := &ResultData{
|
|
|
- channelType: 1,
|
|
|
- channel: "中间人",
|
|
|
- size: len(r3),
|
|
|
- data: r3,
|
|
|
+ if pTmp.BuyerId != "" {
|
|
|
+ r3 := GetData1(req.PositionId, pTmp.BuyerId)
|
|
|
+ if r3 != nil && len(r3) > 0 {
|
|
|
+ tmp := &ResultData{
|
|
|
+ channelType: 1,
|
|
|
+ channel: "中间人",
|
|
|
+ size: len(r3),
|
|
|
+ data: r3,
|
|
|
+ }
|
|
|
+ result = append(result, tmp)
|
|
|
+ }
|
|
|
+ // 关联单位
|
|
|
+ r4 := GetData2(pTmp.BuyerId)
|
|
|
+ if r4 != nil && len(r4) > 0 {
|
|
|
+ tmp := &ResultData{
|
|
|
+ channelType: 1,
|
|
|
+ channel: "业主关联单位",
|
|
|
+ size: len(r4),
|
|
|
+ data: r4,
|
|
|
+ }
|
|
|
+ result = append(result, tmp)
|
|
|
}
|
|
|
- result = append(result, tmp)
|
|
|
}
|
|
|
- // 关联单位
|
|
|
- GetData2(common.ObjToString(pMap["buyer_id"]))
|
|
|
-
|
|
|
return
|
|
|
}
|
|
|
|