瀏覽代碼

Merge branch 'eta/1.1.6' into debug

Roc 1 年之前
父節點
當前提交
6f463e8fda
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 7 1
      models/base_calculate.go
  2. 1 1
      models/base_from_smm.go

+ 7 - 1
models/base_calculate.go

@@ -19,7 +19,7 @@ type EdbInfoData struct {
 	Value     float64   `description:"数据"`
 }
 
-// BaseCalculate
+// BaseCalculateBySearchData
 // @Description: 基础的计算公式
 type BaseCalculateBySearchData struct {
 	DataList      []*EdbInfoSearchData
@@ -582,6 +582,9 @@ func (obj BaseCalculate) Hbz() (dateDataMap map[time.Time]float64, err error, er
 	}
 
 	// 数据处理
+	// 数据降序
+	dataList = reverseSliceByDesc(dataList)
+
 	var dateArr []time.Time
 	for _, v := range dataList {
 		dateArr = append(dateArr, v.DataTime)
@@ -654,6 +657,9 @@ func (obj BaseCalculate) Hcz() (dateDataMap map[time.Time]float64, err error, er
 	}
 
 	// 数据处理
+	// 数据降序
+	dataList = reverseSliceByDesc(dataList)
+
 	var dateArr []time.Time
 	for _, v := range dataList {
 		dateArr = append(dateArr, v.DataTime)

+ 1 - 1
models/base_from_smm.go

@@ -79,7 +79,7 @@ func AddEdbDataFromSmm(edbCode string) (err error) {
 	return
 }
 
-// 刷新有色指标数据
+// RefreshEdbDataFromSmm 刷新有色指标数据
 func RefreshEdbDataFromSmm(edbInfoId int, edbCode, startDate string) (err error) {
 	source := utils.DATA_SOURCE_YS
 	o := orm.NewOrm()