|
@@ -89,7 +89,8 @@ func GetPrList(req *types.CoopHistoryReq) (result []*ResultData, size_1, size_2,
|
|
|
if err != nil {
|
|
|
return nil, 0, 0, 0, 0
|
|
|
}
|
|
|
- propertyForm := T.NetworkCom.GetMyProbusfor(req.EntAccountId)
|
|
|
+ //propertyForm := T.NetworkCom.GetMyProbusfor(req.EntAccountId)
|
|
|
+ scopeClass := FindBusiness(req.EntId, req.EntUserId)
|
|
|
// firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构 sup_sub: 上下级
|
|
|
// 1、同甲异业数据/ 3、招标代理机构渠道
|
|
|
if pTmp.BuyerId != "" {
|
|
@@ -131,7 +132,7 @@ func GetPrList(req *types.CoopHistoryReq) (result []*ResultData, size_1, size_2,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- rs1, rs2 := GetData(propertyForm, pTmp.BuyerId)
|
|
|
+ rs1, rs2 := GetData(strings.Split(scopeClass, ","), pTmp.BuyerId)
|
|
|
r1 := rs1[pTmp.BuyerId]
|
|
|
r2 := rs2[pTmp.BuyerId]
|
|
|
if r1 != nil && len(r1) > 0 {
|
|
@@ -174,7 +175,7 @@ func GetPrList(req *types.CoopHistoryReq) (result []*ResultData, size_1, size_2,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetData(propertyForm []string, bid string) (result1, result2 map[string][]map[string]interface{}) {
|
|
|
+func GetData(scopeClass []string, bid string) (result1, result2 map[string][]map[string]interface{}) {
|
|
|
result1, result2 = map[string][]map[string]interface{}{}, map[string][]map[string]interface{}{}
|
|
|
type AggStruct struct {
|
|
|
Buckets []struct {
|
|
@@ -200,10 +201,10 @@ func GetData(propertyForm []string, bid string) (result1, result2 map[string][]m
|
|
|
m1 := make(map[string]interface{}) //采购单位-中标单位
|
|
|
m2 := make(map[string]interface{}) //采购单位-代理机构
|
|
|
noIds := []string{}
|
|
|
- if len(propertyForm) > 0 {
|
|
|
+ if len(scopeClass) > 0 {
|
|
|
//同甲异态 中标企业
|
|
|
- aggs, _, _ := elastic.GetAggs(INDEX_1, INDEX_1, fmt.Sprintf(es_query, strings.ReplaceAll(bid, ",", `","`), strings.Join(propertyForm, "\",\"")))
|
|
|
- logx.Info("es聚合查询结果:", fmt.Sprintf(es_query, strings.ReplaceAll(bid, ",", `","`), strings.Join(propertyForm, "\",\"")))
|
|
|
+ aggs, _, _ := elastic.GetAggs(INDEX_1, INDEX_1, fmt.Sprintf(es_query, strings.ReplaceAll(bid, ",", `","`), strings.Join(scopeClass, "\",\"")))
|
|
|
+ logx.Info("es聚合查询结果:", fmt.Sprintf(es_query, strings.ReplaceAll(bid, ",", `","`), strings.Join(scopeClass, "\",\"")))
|
|
|
var m1Buckets = AggStruct{}
|
|
|
if aggs != nil && aggs["winner_count"] != nil {
|
|
|
bs, err := aggs["winner_count"].MarshalJSON()
|