Commit e4dc193a authored by 李科's avatar 李科

fix: 预警规则设置列表排序

parent 43d0f8d0
......@@ -298,7 +298,9 @@ func (a *AlertRulesSvc) List(req request.ListAlertRules) (resp response.AlertRul
Or("ac.class_name LIKE ?", "%"+req.Keyword+"%").
Or("acp.class_name LIKE ?", "%"+req.Keyword+"%")
}
resp.TotalCount, err = session.Limit(req.GetPageSize(), (req.GetPage()-1)*req.GetPageSize()).FindAndCount(&resp.List)
resp.TotalCount, err = session.Limit(req.GetPageSize(), (req.GetPage()-1)*req.GetPageSize()).
OrderBy("r.created_at desc").
FindAndCount(&resp.List)
for i := 0; i < len(resp.List); i++ {
_ = json.Unmarshal([]byte(resp.List[i].AlertRules.AlertCondition), &resp.List[i].AlertCondition)
_ = json.Unmarshal([]byte(resp.List[i].AlertRules.AlertRange), &resp.List[i].AlertRange)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment