日志列表错误

This commit is contained in:
陈俊宏 2024-12-04 18:53:50 +08:00
parent 30460ff8c5
commit e24aabb8f0
1 changed files with 3 additions and 3 deletions

View File

@ -9,14 +9,14 @@ import (
func CronFuncLogsList(request *backend.CronFuncLogsListRequest, page int, limit int) (count int64, listInfo []cronfunclogsmodel.CronFuncLogs, err error) {
conn := builder.NewCond()
if request.CmdId != 0 {
conn = conn.And(builder.Eq{"CmdId": request.CmdId})
conn = conn.And(builder.Eq{"cmd_id": request.CmdId})
}
if request.Status != 0 {
conn = conn.And(builder.Eq{"Status": request.Status})
conn = conn.And(builder.Eq{"status": request.Status})
}
session := cronfunclogsmodel.GetInstance().GetDb().Where(conn)
if page != 0 && limit != 0 {
session = session.OrderBy("create_time desc").Limit(limit, (page-1)*limit)
session = session.OrderBy("log_id desc").Limit(limit, (page-1)*limit)
}
count, err = session.FindAndCount(&listInfo)
if err != nil {