Prechádzať zdrojové kódy

Merge branch 'ETA_1.9.4' into debug

zwxi 8 mesiacov pred
rodič
commit
c2f151f119
1 zmenil súbory, kde vykonal 2 pridanie a 4 odobranie
  1. 2 4
      services/data/chart_info.go

+ 2 - 4
services/data/chart_info.go

@@ -4192,8 +4192,7 @@ func SeasonChartData(dataList []*data_manage.ChartEdbInfoMapping, seasonExtraCon
 						err = errors.New("时间格式化异常, Err:" + e.Error())
 						return
 					}
-					yearRange := time.Now().Year() - seasonConfig.SamePeriodAverage.Year
-					startYear := time.Now().AddDate(-yearRange, 0, 0).Year()
+					startYear := time.Now().AddDate(-seasonConfig.SamePeriodAverage.Year, 0, 0).Year()
 					if dateTime.Year() < startYear {
 						continue
 					}
@@ -4243,8 +4242,7 @@ func SeasonChartData(dataList []*data_manage.ChartEdbInfoMapping, seasonExtraCon
 
 		// 自定义同期标准差
 		if seasonConfig.SamePeriodStandardDeviation.Year > 1 && seasonConfig.SamePeriodStandardDeviation.Multiple > 0 {
-			yearRange := time.Now().Year() - seasonConfig.SamePeriodAverage.Year
-			startYear := time.Now().AddDate(-yearRange, 0, 0).Year()
+			startYear := time.Now().AddDate(-seasonConfig.SamePeriodStandardDeviation.Year, 0, 0).Year()
 
 			// 先算均值,再算标准差
 			handleDataMap := make(map[string]float64)