Procházet zdrojové kódy

fix:跳过中标名称为空的项目

duxin před 3 roky
rodič
revize
20a5ecdb7f

+ 9 - 2
src/jfw/modules/bigmember/src/entity/marketAnalysis/customizad_distribution.go

@@ -733,6 +733,9 @@ func BuyerAnalysis(thisBuyerRow BuyerWinnerRow, rMap map[string]interface{}, win
 		for _, v1 := range v.SWinnerTop.Buckets {
 			var _dd number_project
 			_dd.Number = v1.BuyerWinnerAmount.Value
+			if winnerName[v1.Key] == "" {
+				continue
+			}
 			_dd.Name = winnerName[v1.Key]
 			_dd.Id = util.EncodeId(v1.Key)
 
@@ -772,11 +775,12 @@ func BuyerAnalysis(thisBuyerRow BuyerWinnerRow, rMap map[string]interface{}, win
 
 		var ss []interface{}
 		for _, v1 := range v.SWinnerTop.Buckets {
-			if v1.BuyerWinnerAmount.Value == 0 {
+			if v1.BuyerWinnerAmount.Value == 0 || winnerName[v1.Key] == "" {
 				continue
 			}
 			var _dd amount_project
 			_dd.Amount = v1.BuyerWinnerAmount.Value
+
 			_dd.Name = winnerName[v1.Key]
 			_dd.Id = util.EncodeId(v1.Key)
 			/*	if _d.Amount != 0 {
@@ -840,6 +844,9 @@ func WinningAnalysis(thisWinnerRow BuyerWinnerRow, rMap map[string]interface{},
 	for _, v := range thisWinnerRow.WinnerCountTop3.SWinnerCount {
 		var _d number_projects
 		_d.Number = v.BuyerCount.Value
+		if winnerName[v.Key] == "" {
+			continue
+		}
 		_d.Name = winnerName[v.Key]
 		_d.Id = util.EncodeId(v.Key)
 		/*if thisWinnerRow.ProjectCount.Value != 0 {
@@ -875,7 +882,7 @@ func WinningAnalysis(thisWinnerRow BuyerWinnerRow, rMap map[string]interface{},
 	}
 	amountMap := []interface{}{}
 	for _, v := range thisWinnerRow.WinnerAmountTop3.SWinnerAmount {
-		if v.SWinnerAmount.Value == 0 {
+		if v.SWinnerAmount.Value == 0 || winnerName[v.Key] == "" {
 			continue
 		}
 		var _d amount_projects