Explorar o código

更新告警规则模糊搜索

lijian %!s(int64=6) %!d(string=hai) anos
pai
achega
c856169cd6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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