|
@@ -293,14 +293,14 @@ func GetEdbInfoCalculateCountByCondition(condition string, pars []interface{}) (
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
type EdbInfoSearchDataV1 struct {
|
|
|
EdbDataId int `description:"数据ID"`
|
|
|
DataTime string `description:"数据日期"`
|
|
|
Value string `description:"数据"`
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
func GetEdbDataListAllV1(condition string, pars []interface{}, source, order int) (item []*EdbInfoSearchDataV1, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := ``
|
|
@@ -729,18 +729,18 @@ func GetPredictDataListByPredictEdbInfo(edbInfo *EdbInfo, order int, startDate s
|
|
|
condition += " AND data_time>=? "
|
|
|
pars = append(pars, startDate)
|
|
|
}
|
|
|
- dataList, err = GetEdbDataListAll(condition, pars, sourceEdbInfoItem.Source, order)
|
|
|
+ tmpDataList, err := GetEdbDataListAll(condition, pars, sourceEdbInfoItem.Source, 1)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
if startDate != `` {
|
|
|
- allDataList, err = GetEdbDataListAll(" AND edb_info_id=? ", []interface{}{sourceEdbInfoItem.EdbInfoId}, sourceEdbInfoItem.Source, order)
|
|
|
+ allDataList, err = GetEdbDataListAll(" AND edb_info_id=? ", []interface{}{sourceEdbInfoItem.EdbInfoId}, sourceEdbInfoItem.Source, 1)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
} else {
|
|
|
- allDataList = dataList
|
|
|
+ allDataList = tmpDataList
|
|
|
}
|
|
|
|
|
|
|
|
@@ -758,16 +758,20 @@ func GetPredictDataListByPredictEdbInfo(edbInfo *EdbInfo, order int, startDate s
|
|
|
|
|
|
|
|
|
if order == 1 {
|
|
|
- dataList = append(dataList, predictDataList...)
|
|
|
- }else{
|
|
|
+ dataList = append(tmpDataList, predictDataList...)
|
|
|
+ } else {
|
|
|
+
|
|
|
lenPredictDataList := len(predictDataList)
|
|
|
- if lenPredictDataList >0 {
|
|
|
- tmpDataList :=make([]*EdbInfoSearchData,0)
|
|
|
- for k,_:=range predictDataList{
|
|
|
- tmpDataList = append(tmpDataList,predictDataList[lenPredictDataList-k-1])
|
|
|
+ if lenPredictDataList > 0 {
|
|
|
+ for k := range predictDataList {
|
|
|
+ dataList = append(dataList, predictDataList[lenPredictDataList-k-1])
|
|
|
}
|
|
|
- tmpDataList = append(tmpDataList,dataList...)
|
|
|
- dataList = tmpDataList
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ lenDataList := len(tmpDataList)
|
|
|
+ for k := range tmpDataList {
|
|
|
+ dataList = append(dataList, tmpDataList[lenDataList-k-1])
|
|
|
}
|
|
|
}
|
|
|
if len(predictDataList) > 0 {
|