瀏覽代碼

Merge branch 'refs/heads/eta_2.1.9_index_phase_shift_0909@guomengyuan' into debug

gmy 6 月之前
父節點
當前提交
b9a81fd08a
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      models/edb_data_calculate_phase_shift.go
  2. 2 2
      models/predict_edb_data_calculate_phase_shift.go

+ 2 - 2
models/edb_data_calculate_phase_shift.go

@@ -285,7 +285,7 @@ func refreshAllCalculatePhaseShift(to orm.TxOrmer, edbInfoId, source, subSource,
 		if moveType != 2 {
 			periods := dataLen - i + formulaInt - 1
 			if periods < dataLen {
-				newIndex := dataList[i-1]
+				newIndex := dataList[dataLen-periods-1]
 				resultMap[newIndex.DataTime] = currentIndex.Value
 			} else {
 				// 新数据须根据频度补充key
@@ -301,7 +301,7 @@ func refreshAllCalculatePhaseShift(to orm.TxOrmer, edbInfoId, source, subSource,
 			// 滞后
 			periods := dataLen - i - formulaInt
 			if periods > 0 {
-				newIndex := dataList[periods]
+				newIndex := dataList[dataLen-periods]
 				resultMap[newIndex.DataTime] = currentIndex.Value
 			} else {
 				// 新数据须根据频度补充key

+ 2 - 2
models/predict_edb_data_calculate_phase_shift.go

@@ -240,7 +240,7 @@ func refreshAllPredictCalculatePhaseShift(to orm.TxOrmer, edbInfoId, source, sub
 		if moveType != 2 {
 			periods := dataLen - i + formulaInt - 1
 			if periods < dataLen {
-				newIndex := dataList[i-1]
+				newIndex := dataList[dataLen-periods-1]
 				resultMap[newIndex.DataTime] = currentIndex.Value
 			} else {
 				// 新数据须根据频度补充key
@@ -257,7 +257,7 @@ func refreshAllPredictCalculatePhaseShift(to orm.TxOrmer, edbInfoId, source, sub
 			// 滞后
 			periods := dataLen - i - formulaInt
 			if periods > 0 {
-				newIndex := dataList[periods]
+				newIndex := dataList[dataLen-periods]
 				resultMap[newIndex.DataTime] = currentIndex.Value
 			} else {
 				// 新数据须根据频度补充key