Эх сурвалжийг харах

fix:最大最小值的问题

Roc 2 жил өмнө
parent
commit
d2e73d0a36

+ 6 - 2
services/data/chart_info.go

@@ -297,8 +297,12 @@ func GetChartEdbData(chartInfoId, chartType int, calendar, startDate, endDate st
 			dataList, err = models.GetEdbDataList(v.Source, v.EdbInfoId, startDateReal, endDate)
 		case 1:
 			newEdbInfo, dataList, _, _, err, _ = GetPredictDataListByPredictEdbInfoId(v.EdbInfoId, startDateReal, endDate, false)
-			item.MaxData = newEdbInfo.MaxValue
-			item.MinData = newEdbInfo.MinValue
+			if item.MaxValue < newEdbInfo.MaxValue {
+				item.MaxData = newEdbInfo.MaxValue
+			}
+			if item.MinData > newEdbInfo.MinValue {
+				item.MinData = newEdbInfo.MinValue
+			}
 		default:
 			err = errors.New(fmt.Sprint("获取失败,指标类型异常", v.EdbInfoCategoryType))
 		}