@@ -4428,8 +4428,8 @@ func (this *EdbInfoController) RelationEdbList() {
list, err := data_manage.GetRelationEdbInfoListByCondition(condition, pars, startSize, pageSize)
if err != nil && !utils.IsErrNoRow(err) {
br.Success = true
- br.Msg = "获取图表信息失败"
- br.ErrMsg = "获取图表信息失败,Err:" + err.Error()
+ br.Msg = "获取指标信息失败"
+ br.ErrMsg = "获取指标信息失败,Err:" + err.Error()
return
}
@@ -159,6 +159,8 @@ func GetRelationEdbInfoListByCondition(condition string, pars []interface{}, sta
if condition != "" {
sql += condition
+ //sql += " ORDER BY sort ASC,chart_info_id DESC LIMIT ?,? "
+ sql += " ORDER BY a.create_time DESC LIMIT ?,? "
pars = append(pars, startSize, pageSize)
err = o.Raw(sql, pars...).Find(&item).Error
@@ -5,6 +5,7 @@ import (
"eta/eta_api/global"
"eta/eta_api/utils"
"fmt"
+ "gorm.io/gorm"
"time"
)
@@ -35,6 +36,14 @@ type ReportChapterType struct {
InheritReportChapterTypeId int `description:"继承的报告章节类型id"`
+// AfterFind 在该模型上设置钩子函数,把日期转成正确的string,所以查询函数只能用Find函数,First或者Scan是不会触发该函数的来获取数据
+func (m *ReportChapterType) AfterFind(db *gorm.DB) (err error) {
+ m.PauseStartTime = utils.GormDateStrToDateStr(m.PauseStartTime)
+ m.PauseEndTime = utils.GormDateStrToDateStr(m.PauseEndTime)
+
+ return
+}
func (r *ReportChapterType) Create() (err error) {
err = global.DbMap[utils.DbNameReport].Create(r).Error