|
@@ -15,7 +15,7 @@ const (
|
|
|
query_top10 = `,"sort": [{"sortprice": "desc"}],"from": 0,"size": 10`
|
|
|
aggs_area_amounttop3 = `"area_amount_top3":{"terms":{"field":"area","exclude":["全国"],"order":[{"area_amount":"desc"}],"size":3},"aggs":{"area_amount":{"sum":{"field":"sortprice"}},"winner_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"area_winner_amount":"desc"}],"size":3},"aggs":{"area_winner_amount":{"sum":{"field":"sortprice"}}}}}}`
|
|
|
aggs_area_counttop3 = `"area_count_top3":{"terms":{"field":"area","exclude":["全国"],"order":[{"area_count":"desc"}],"size":3},"aggs":{"area_count":{"filter":{}},"winner_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"area_winner_count":"desc"}],"size":3},"aggs":{"area_winner_count":{"filter":{}}}}}}`
|
|
|
- aggs_buyerclass = `"buyerclass_scale":{"terms":{"field":"buyerclass",size:0,"exclude":["其它",""]},"aggs":{"buyerclass_amount":{"sum":{"field":"sortprice"}},"buyerclass_total":{"filter":{}}}}`
|
|
|
+ aggs_buyerclass = `"buyerclass_scale":{"terms":{"field":"buyerclass","size":0,"exclude":["其它",""]},"aggs":{"buyerclass_amount":{"sum":{"field":"sortprice"}},"buyerclass_total":{"filter":{}}}}`
|
|
|
aggs_buyerclass_other = `"buyerclass_scale_other":{"terms":{"field":"buyerclass","include":["其它",""]},"aggs":{"buyerclass_amount":{"sum":{"field":"sortprice"}},"buyerclass_total":{"filter":{}}}}`
|
|
|
aggs_buyerclass_counttop3 = `"buyerclass_count_top3":{"terms":{"field":"buyerclass","exclude":["其它",""],"order":[{"buyerclass_count":"desc"}],"size":3},"aggs":{"buyerclass_count":{"filter":{}},"bidcount_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"buyer_winner_count":"desc"}],"size":3},"aggs":{"buyer_winner_count":{"filter":{}}}}}}`
|
|
|
aggs_buyerclass_amounttop3 = `"buyerclass_amount_top3":{"terms":{"field":"buyerclass","exclude":["其它",""],"order":[{"buyerclass_amount":"desc"}],"size":3},"aggs":{"buyerclass_amount":{"sum":{"field":"sortprice"}},"winner_top":{"terms":{"field":"entidlist","exclude": ["-"],"order":[{"buyer_winner_amount":"desc"}],"size":3},"aggs":{"buyer_winner_amount":{"sum":{"field":"sortprice"}}}}}}`
|
|
@@ -432,6 +432,7 @@ func CustomerDistribute(thisRow AreaCTop) (data []map[string]interface{}, otherD
|
|
|
amount += v.BuyclassAmount.Value
|
|
|
}
|
|
|
if total != 0 || amount != 0 {
|
|
|
+ otherData = make(map[string]interface{})
|
|
|
otherData["buyclass"] = "其它"
|
|
|
otherData["total"] = total
|
|
|
otherData["amount"] = amount
|