Explorar o código

Merge branch 'pool/231' into debug

Roc %!s(int64=2) %!d(string=hai) anos
pai
achega
90f5e2deff
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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