Эх сурвалжийг харах

fix:商品价格曲线日期展示的bug修复

Roc 2 жил өмнө
parent
commit
f65c2a4178

+ 4 - 0
services/data/future_good/chart_info.go

@@ -385,6 +385,10 @@ func GetNeedDateData(needDateTime time.Time, dataList []*models.EdbDataList, edb
 	for tmpDateTime := needDateTime; tmpDateTime.After(minDateTime) || tmpDateTime.Equal(minDateTime); tmpDateTime = tmpDateTime.AddDate(0, 0, -1) {
 		tmpDate := tmpDateTime.Format(utils.FormatDate)
 		if tmpValue, ok := edbDataMap[tmpDate]; ok { //如果能找到数据,那么就返回
+			// 数据为0,也直接返回,做无值处理
+			if tmpValue == 0 {
+				return
+			}
 			findDateTime, _ = time.ParseInLocation(utils.FormatDate, tmpDate, time.Local)
 			findDataValue = tmpValue
 			isFind = true