소스 검색

fix:预测指标,季节性规则,平移日期反了的bug修复

Roc 2 년 전
부모
커밋
fbdf84572f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      models/predict_edb_info_rule.go

+ 1 - 1
models/predict_edb_info_rule.go

@@ -811,7 +811,7 @@ func GetChartPredictEdbInfoDataListByRuleSeason(edbInfoId int, yearsList []int,
 			var isFindHistoryCurrent, isFindHistoryLast bool //是否找到前几年的数据
 
 			//前几年当日的日期
-			tmpHistoryCurrentDate := currentDate.AddDate(year-currentDate.Year(), 0, moveDay)
+			tmpHistoryCurrentDate := currentDate.AddDate(year-currentDate.Year(), 0, -moveDay)
 			for i := 0; i <= 35; i++ { // 前后35天找数据,找到最近的值,先向后面找,再往前面找
 				tmpDate := tmpHistoryCurrentDate.AddDate(0, 0, i)
 				if val, ok := existMap[tmpDate.Format(utils.FormatDate)]; ok {