瀏覽代碼

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
 					err = tmpErr
 					return
 					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)
 					tmpDate := tmpDateTime.Format(utils.FormatDate)
 					if _, ok := edbDataMap[edbInfoId][tmpDate]; ok { //如果能找到数据,那么就返回
 					if _, ok := edbDataMap[edbInfoId][tmpDate]; ok { //如果能找到数据,那么就返回
 						findDate = tmpDate
 						findDate = tmpDate
@@ -820,7 +820,7 @@ func BarChartData(mappingList []*chartEdbMappingModel.ChartEdbInfoMapping, edbDa
 					err = tmpErr
 					err = tmpErr
 					return
 					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)
 					tmpDate := tmpDateTime.Format(utils.FormatDate)
 					if _, ok := edbDataMap[edbInfoId][tmpDate]; ok { //如果能找到数据,那么就返回
 					if _, ok := edbDataMap[edbInfoId][tmpDate]; ok { //如果能找到数据,那么就返回
 						findDate = tmpDate
 						findDate = tmpDate