Browse Source

更新告警规则模糊搜索

lijian 6 years ago
parent
commit
8761d31430
1 changed files with 1 additions and 1 deletions
  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 like ?", "%"+name+"%")
 	}
 	err = tx.Limit(ps).Offset((pi - 1) * ps).Find(&datas).Error
 	err = tx.Model(&models.AlarmRule{}).Count(&total).Error