浏览代码

更新告警规则模糊搜索

lijian 6 年之前
父节点
当前提交
c856169cd6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      services/knowoapi/model/alert.go

+ 1 - 1
services/knowoapi/model/alert.go

@@ -67,7 +67,7 @@ func (a *Alert) GetRules(vendorid uint, pi, ps, proid, protocalid int, name stri
 		tx = tx.Where("protocal_id = ?", protocalid)
 	}
 	if name != "" {
-		tx = tx.Where("alert_name = ?", name)
+		tx = tx.Where("alert_name = ?", "%"+name+"%")
 	}
 	err = tx.Limit(ps).Offset((pi - 1) * ps).Find(&datas).Error
 	err = tx.Model(&models.AlarmRule{}).Count(&total).Error