浏览代码

Merge branch '12.0' into debug

Roc 2 年之前
父节点
当前提交
d637a9f239
共有 3 个文件被更改,包括 5 次插入2 次删除
  1. 1 0
      models/chart.go
  2. 1 0
      models/data_manage/chart_info.go
  3. 3 2
      services/data/chart_info.go

+ 1 - 0
models/chart.go

@@ -158,6 +158,7 @@ type YData struct {
 	Date  string    `description:"数据日期"`
 	Color string    `description:"数据颜色"`
 	Value []float64 `description:"每个指标的值"`
+	Name  string    `description:"别名"`
 }
 
 //指标季度数据计算(公历转农历)

+ 1 - 0
models/data_manage/chart_info.go

@@ -128,6 +128,7 @@ type BarChartInfoDateReq struct {
 	Date  string `description:"固定日期"`
 	Value int    `description:"N天的值"`
 	Color string `description:"颜色"`
+	Name  string `description:"别名"`
 }
 
 // BarChartInfoSortReq 柱方图预览请求数据(排序相关)

+ 3 - 2
services/data/chart_info.go

@@ -507,7 +507,7 @@ func BarChartData(mappingList []*models.ChartEdbInfoMapping, edbDataListMap map[
 					err = tmpErr
 					return
 				}
-				for tmpDateTime := findDateTime; tmpDateTime.After(minDateTime) || tmpDateTime.Equal(minDateTime); tmpDateTime.AddDate(0, 0, -1) {
+				for tmpDateTime := findDateTime; tmpDateTime.After(minDateTime) || tmpDateTime.Equal(minDateTime); tmpDateTime = tmpDateTime.AddDate(0, 0, -1) {
 					tmpDate := tmpDateTime.Format(utils.FormatDate)
 					if _, ok := edbDataMap[edbInfoId][tmpDate]; ok { //如果能找到数据,那么就返回
 						findDate = tmpDate
@@ -595,7 +595,7 @@ func BarChartData(mappingList []*models.ChartEdbInfoMapping, edbDataListMap map[
 					err = tmpErr
 					return
 				}
-				for tmpDateTime := findDateTime; tmpDateTime.After(minDateTime) || tmpDateTime.Equal(minDateTime); tmpDateTime.AddDate(0, 0, -1) {
+				for tmpDateTime := findDateTime; tmpDateTime.After(minDateTime) || tmpDateTime.Equal(minDateTime); tmpDateTime = tmpDateTime.AddDate(0, 0, -1) {
 					tmpDate := tmpDateTime.Format(utils.FormatDate)
 					if _, ok := edbDataMap[edbInfoId][tmpDate]; ok { //如果能找到数据,那么就返回
 						findDate = tmpDate
@@ -625,6 +625,7 @@ func BarChartData(mappingList []*models.ChartEdbInfoMapping, edbDataListMap map[
 			Date:  maxDate.Format(utils.FormatDate),
 			Value: findDataList,
 			Color: barChartInfoDate.Color,
+			Name:  barChartInfoDate.Name,
 		})
 	}