浏览代码

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

Roc 2 年之前
父节点
当前提交
f65c2a4178
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      services/data/future_good/chart_info.go

+ 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