|
@@ -1102,13 +1102,27 @@ func (t *OwnerService) CandidateChannel() (*ResultDatas, int, int, int, int) {
|
|
|
for buyerId := range *dataMap {
|
|
|
buyerIds = append(buyerIds, buyerId)
|
|
|
}
|
|
|
+ if len(buyerIds) > 300 {
|
|
|
+ buyerIds = buyerIds[:300]
|
|
|
+ }
|
|
|
rs1, rs2 := GetData(propertyForm, strings.Join(buyerIds, ","))
|
|
|
+ winners, agency := []string{}, []string{}
|
|
|
+ for buyerId := range *dataMap {
|
|
|
+ for _, m := range rs1[buyerId] {
|
|
|
+ winners = append(winners, common.ObjToString(m["name"]))
|
|
|
+ }
|
|
|
+ for _, m := range rs2[buyerId] {
|
|
|
+ agency = append(agency, common.ObjToString(m["name"]))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ltcs1, ltcs2 := LastTimeCoopBath(buyerIds, winners, agency)
|
|
|
for buyerId := range *dataMap {
|
|
|
- r1 := rs1[buyerId]
|
|
|
- r2 := rs2[buyerId]
|
|
|
- if r1 != nil && len(r1) > 0 {
|
|
|
- for _, m := range r1 {
|
|
|
- near, zbtime := LastTimeCoop(buyerId, common.ObjToString(m["name"]), "adiffb")
|
|
|
+ if ltcs1[buyerId] != nil {
|
|
|
+ for _, m := range rs1[buyerId] {
|
|
|
+ ltc := ltcs1[buyerId][common.ObjToString(m["name"])]
|
|
|
+ if ltc == nil {
|
|
|
+ continue
|
|
|
+ }
|
|
|
tmp := ResultData{
|
|
|
SourceType: "adiffb",
|
|
|
EntId: common.ObjToString(m["nameId"]),
|
|
@@ -1116,8 +1130,8 @@ func (t *OwnerService) CandidateChannel() (*ResultDatas, int, int, int, int) {
|
|
|
ProjectNum: common.IntAll(m["coop_size"]),
|
|
|
TotalAmount: common.Float64All(m["coop_amount"]),
|
|
|
BuyerId: buyerId,
|
|
|
- RecentTime: zbtime,
|
|
|
- NearlyYears: near,
|
|
|
+ RecentTime: ltc.ZbTime,
|
|
|
+ NearlyYears: ltc.Near,
|
|
|
}
|
|
|
if tmp.EntId == "" || tmp.BuyerId == "" {
|
|
|
continue
|
|
@@ -1126,16 +1140,19 @@ func (t *OwnerService) CandidateChannel() (*ResultDatas, int, int, int, int) {
|
|
|
returnData = append(returnData, &tmp)
|
|
|
}
|
|
|
}
|
|
|
- if r2 != nil && len(r2) > 0 {
|
|
|
- for _, m := range r2 {
|
|
|
- near, zbtime := LastTimeCoop(buyerId, common.ObjToString(m["name"]), "agency")
|
|
|
+ if ltcs2[buyerId] != nil {
|
|
|
+ for _, m := range rs2[buyerId] {
|
|
|
+ ltc := ltcs1[buyerId][common.ObjToString(m["name"])]
|
|
|
+ if ltc == nil {
|
|
|
+ continue
|
|
|
+ }
|
|
|
tmp := ResultData{
|
|
|
SourceType: "agency",
|
|
|
EntName: common.ObjToString(m["name"]),
|
|
|
ProjectNum: common.IntAll(m["coop_size"]),
|
|
|
TotalAmount: common.Float64All(m["coop_amount"]),
|
|
|
- RecentTime: zbtime,
|
|
|
- NearlyYears: near,
|
|
|
+ RecentTime: ltc.ZbTime,
|
|
|
+ NearlyYears: ltc.Near,
|
|
|
EntId: common.ObjToString(m["nameId"]),
|
|
|
BuyerId: buyerId,
|
|
|
}
|
|
@@ -1146,7 +1163,6 @@ func (t *OwnerService) CandidateChannel() (*ResultDatas, int, int, int, int) {
|
|
|
returnData = append(returnData, &tmp)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
// 中间人可介绍业主
|
|
|
var r3 []map[string]interface{}
|
|
|
r3 = FindMiddleman([]string{fmt.Sprintf("'%s'", buyerId)}, t.PositionId, r3)
|