浏览代码

fix:固定日期的bug修复

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

+ 2 - 2
services/chart/chart_info.go

@@ -732,7 +732,7 @@ func BarChartData(mappingList []*chartEdbMappingModel.ChartEdbInfoMapping, edbDa
 					err = tmpErr
 					return
 				}
-				for tmpDateTime := findDateTime; tmpDateTime.After(minDateTime) || tmpDateTime.Equal(minDateTime); tmpDateTime.AddDate(0, 0, -1) {
+				for tmpDateTime := findDateTime; tmpDateTime.After(minDateTime) || tmpDateTime.Equal(minDateTime); tmpDateTime = tmpDateTime.AddDate(0, 0, -1) {
 					tmpDate := tmpDateTime.Format(utils.FormatDate)
 					if _, ok := edbDataMap[edbInfoId][tmpDate]; ok { //如果能找到数据,那么就返回
 						findDate = tmpDate
@@ -820,7 +820,7 @@ func BarChartData(mappingList []*chartEdbMappingModel.ChartEdbInfoMapping, edbDa
 					err = tmpErr
 					return
 				}
-				for tmpDateTime := findDateTime; tmpDateTime.After(minDateTime) || tmpDateTime.Equal(minDateTime); tmpDateTime.AddDate(0, 0, -1) {
+				for tmpDateTime := findDateTime; tmpDateTime.After(minDateTime) || tmpDateTime.Equal(minDateTime); tmpDateTime = tmpDateTime.AddDate(0, 0, -1) {
 					tmpDate := tmpDateTime.Format(utils.FormatDate)
 					if _, ok := edbDataMap[edbInfoId][tmpDate]; ok { //如果能找到数据,那么就返回
 						findDate = tmpDate