瀏覽代碼

更新sql问题

lijian 6 年之前
父節點
當前提交
5fde2cd35e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      services/knowoapi/model/alert.go

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

@@ -61,7 +61,7 @@ func (a *Alert) Update(vendorid uint, alert *models.AlarmRule) (data models.Alar
 func (a *Alert) GetRules(vendorid uint, pi, ps, proid, protocalid int, name string) (datas []models.AlarmRule, total int, err error) {
 	tx := a.db.Where("vendor_id = ? and 1=1", vendorid)
 	if proid != 0 {
-		tx = tx.Where("product_id = ?")
+		tx = tx.Where("product_id = ?", proid)
 	}
 	if protocalid != 0 {
 		tx = tx.Where("protocal_id = ?", protocalid)