Roc 2 years ago
parent
commit
6d8f4e3730
1 changed files with 4 additions and 0 deletions
  1. 4 0
      models/edb_data_calculate_nhcc.go

+ 4 - 0
models/edb_data_calculate_nhcc.go

@@ -675,6 +675,10 @@ func handleNhccData(dataList []*EdbInfoSearchData, moveDay int) (newDataList []E
 		currDate := minDate.AddDate(0, 0, i)
 		tmpValue, ok := newDateMap[currDate]
 		if !ok {
+			// 万一没有数据,那么就过滤当次循环
+			if len(newDataList) <= 0 {
+				continue
+			}
 			//找不到数据,那么就用前面的数据吧
 			tmpValue = newDataList[len(newDataList)-1].Value
 		}