浏览代码

Merge branch 'fix/2022-07-18' into debug

Roc 2 年之前
父节点
当前提交
2b2377e9a9
共有 2 个文件被更改,包括 9 次插入1 次删除
  1. 5 1
      controllers/chart.go
  2. 4 0
      models/chart.go

+ 5 - 1
controllers/chart.go

@@ -155,7 +155,11 @@ func (this *ChartController) ChartInfoDetail() {
 		item.EdbCode = v.EdbCode
 		item.EdbName = v.EdbName
 		item.Frequency = v.Frequency
-		item.Unit = v.Unit
+
+		//无就是不展示
+		if v.Unit != `无` {
+			item.Unit = v.Unit
+		}
 		item.StartDate = v.StartDate
 		item.EndDate = v.EndDate
 		//item.ModifyTime = v.ModifyTime

+ 4 - 0
models/chart.go

@@ -140,6 +140,10 @@ func AddCalculateQuarterV5(dataList []*EdbDataList) (result *EdbDataResult, err
 			fmt.Println("errMsg:", errMsg)
 		}
 	}()
+	if len(dataList) <= 0 {
+		result.List = make([]*EdbDataItems, 0)
+		return
+	}
 
 	endDate := dataList[len(dataList)-1].DataTime
 	endDateForm, err := time.Parse(utils.FormatDate, endDate)