Commit aac4f579 authored by 李科's avatar 李科

fix: 完善批量关闭预警

parent 64e49181
...@@ -411,20 +411,15 @@ func (a *AlertSvc) BatchPushAlert(session *xorm.Session, req request.BatchPushAl ...@@ -411,20 +411,15 @@ func (a *AlertSvc) BatchPushAlert(session *xorm.Session, req request.BatchPushAl
} }
func (a *AlertSvc) BatchCloseAlert(req request.BatchCloseAlert) (err error) { func (a *AlertSvc) BatchCloseAlert(req request.BatchCloseAlert) (err error) {
var ids []int
if len(req.Ids) > 0 { if len(req.Ids) > 0 {
for _, id := range req.Ids { ids = req.Ids
err = a.IndexUpdate(request.UpdateAlert{
Id: id,
CloseRemark: req.CloseRemark,
Status: 3,
})
if err != nil {
return
}
}
} else { } else {
ids = append(ids, req.Id)
}
for _, id := range ids {
err = a.IndexUpdate(request.UpdateAlert{ err = a.IndexUpdate(request.UpdateAlert{
Id: req.Id, Id: id,
CloseRemark: req.CloseRemark, CloseRemark: req.CloseRemark,
DeferPush: req.DeferPush, DeferPush: req.DeferPush,
Status: 3, Status: 3,
......
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