Bladeren bron

更新sql问题

lijian 6 jaren geleden
bovenliggende
commit
5fde2cd35e
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  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) {
 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)
 	tx := a.db.Where("vendor_id = ? and 1=1", vendorid)
 	if proid != 0 {
 	if proid != 0 {
-		tx = tx.Where("product_id = ?")
+		tx = tx.Where("product_id = ?", proid)
 	}
 	}
 	if protocalid != 0 {
 	if protocalid != 0 {
 		tx = tx.Where("protocal_id = ?", protocalid)
 		tx = tx.Where("protocal_id = ?", protocalid)