|
@@ -7,6 +7,7 @@ import (
|
|
|
"eta/eta_hub/services"
|
|
|
"eta/eta_hub/services/data"
|
|
|
"eta/eta_hub/utils"
|
|
|
+ "time"
|
|
|
"strings"
|
|
|
)
|
|
|
|
|
@@ -129,16 +130,15 @@ func (this *EdbController) List() {
|
|
|
}()
|
|
|
|
|
|
classifyId, _ := this.GetInt("ClassifyId")
|
|
|
- if classifyId <= 0 {
|
|
|
- br.Msg = "参数有误"
|
|
|
- return
|
|
|
- }
|
|
|
|
|
|
edbOb := new(data_manage.EdbInfo)
|
|
|
- cond := ` AND classify_id = ?`
|
|
|
+ cond := ``
|
|
|
pars := make([]interface{}, 0)
|
|
|
- pars = append(pars, classifyId)
|
|
|
- edbList, e := edbOb.GetItemsByCondition(cond, pars, []string{}, "sort ASC")
|
|
|
+ if classifyId > 0 {
|
|
|
+ cond += ` AND classify_id = ?`
|
|
|
+ pars = append(pars, classifyId)
|
|
|
+ }
|
|
|
+ edbList, e := edbOb.GetItemsByCondition(cond, pars, []string{}, "sort ASC, create_time DESC")
|
|
|
if e != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "EdbList GetItemsByCondition err: " + e.Error()
|
|
@@ -219,6 +219,15 @@ func (this *EdbController) EdbData() {
|
|
|
br.Msg = "参数有误"
|
|
|
return
|
|
|
}
|
|
|
+ startDate := this.GetString("StartDate")
|
|
|
+ if startDate != "" {
|
|
|
+ _, e := time.Parse(utils.FormatDate, startDate)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "开始日期格式有误"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
edbOb := new(data_manage.EdbInfo)
|
|
|
edb, e := edbOb.GetItemByUniCode(unicode)
|
|
|
if e != nil {
|
|
@@ -233,7 +242,7 @@ func (this *EdbController) EdbData() {
|
|
|
|
|
|
// 获取指标数据
|
|
|
dataOb := new(data_manage.EdbData)
|
|
|
- dataList, e := dataOb.GetItemsBySourceAndCode(edb.Source, edb.SubSource, edb.EdbCode, []string{}, "")
|
|
|
+ dataList, e := dataOb.GetItemsBySourceAndCode(edb.Source, edb.SubSource, edb.EdbCode, startDate, []string{}, "")
|
|
|
if e != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "EdbData GetItemsBySourceAndCode err: " + e.Error()
|