|
@@ -44,11 +44,11 @@ type ProjectTmp struct {
|
|
|
PropertyForm []string `ch:"property_form"`
|
|
|
}
|
|
|
|
|
|
-func GetPrList(req *types.CoopHistoryReq) (result []*ResultData) {
|
|
|
+func GetPrList(req *types.CoopHistoryReq) (result []*ResultData, size_1, size_2, size_3, size_4 int64) {
|
|
|
pTmp := ProjectTmp{}
|
|
|
err := T.ClickhouseConn.QueryRow(context.TODO(), sql_2_0, req.Pid).ScanStruct(&pTmp)
|
|
|
if err != nil {
|
|
|
- return nil
|
|
|
+ return nil, 0, 0, 0, 0
|
|
|
}
|
|
|
propertyForm := ""
|
|
|
m1 := T.CrmMysql.FindOne("config_tenant", map[string]interface{}{"account_id": req.EntAccountId}, "probusfor", "")
|
|
@@ -59,7 +59,8 @@ func GetPrList(req *types.CoopHistoryReq) (result []*ResultData) {
|
|
|
// 1、同甲异业数据/ 3、招标代理机构渠道
|
|
|
if req.ChannelType == "0" || req.ChannelType == "1" || req.ChannelType == "3" {
|
|
|
r1, r2 := GetData(propertyForm, pTmp.BuyerId)
|
|
|
- if req.ChannelType != "3" && r1 != nil && len(r1) > 0 {
|
|
|
+ if (req.ChannelType == "0" || req.ChannelType == "1") && r1 != nil && len(r1) > 0 {
|
|
|
+ size_1 = int64(len(r1))
|
|
|
for _, m := range r1 {
|
|
|
near, zbtime := LastTimeCoop(pTmp.BuyerId, common.ObjToString(m["name"]), "adiffb")
|
|
|
tmp := ResultData{
|
|
@@ -73,7 +74,8 @@ func GetPrList(req *types.CoopHistoryReq) (result []*ResultData) {
|
|
|
result = append(result, &tmp)
|
|
|
}
|
|
|
}
|
|
|
- if req.ChannelType != "2" && r2 != nil && len(r2) > 0 {
|
|
|
+ if req.ChannelType == "0" || req.ChannelType == "3" && r2 != nil && len(r2) > 0 {
|
|
|
+ size_3 = int64(len(r2))
|
|
|
for _, m := range r2 {
|
|
|
near, zbtime := LastTimeCoop(pTmp.BuyerId, common.ObjToString(m["name"]), "agency")
|
|
|
tmp := ResultData{
|
|
@@ -92,9 +94,10 @@ func GetPrList(req *types.CoopHistoryReq) (result []*ResultData) {
|
|
|
if req.ChannelType == "0" || req.ChannelType == "4" {
|
|
|
// 中间人可介绍业主
|
|
|
var r3 []map[string]interface{}
|
|
|
- r3 = FindMiddleman([]string{pTmp.BuyerId}, req.PositionId, r3)
|
|
|
+ r3 = FindMiddleman([]string{fmt.Sprintf("'%s'", pTmp.BuyerId)}, req.PositionId, r3)
|
|
|
if r3 != nil && len(r3) > 0 {
|
|
|
for _, m := range r3 {
|
|
|
+ size_4 = int64(len(r3))
|
|
|
tmp := ResultData{
|
|
|
SourceType: "middleman",
|
|
|
EntName: common.ObjToString(m["b_name"]),
|
|
@@ -108,8 +111,9 @@ func GetPrList(req *types.CoopHistoryReq) (result []*ResultData) {
|
|
|
if req.ChannelType == "0" || req.ChannelType == "2" {
|
|
|
// 关联单位
|
|
|
var r4 []map[string]interface{}
|
|
|
- r4 = Findfirstparty([]string{pTmp.BuyerId}, r4)
|
|
|
+ r4 = Findfirstparty([]string{fmt.Sprintf("'%s'", pTmp.BuyerId)}, r4)
|
|
|
if r4 != nil && len(r4) > 0 {
|
|
|
+ size_2 = int64(len(r4))
|
|
|
for _, m := range r4 {
|
|
|
tmp := ResultData{
|
|
|
SourceType: "sup_sub",
|