You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_, err := Ormer().Raw("SELECT id,status FROM alert WHERE rule_id =? AND labels=? AND fired_at=?", a.ruleId, a.label, a.firedAt).QueryRows(&queryres)
if err == nil {
if len(queryres) > 0 {
// alert has been triggered by post requests before
------> if queryres[0].Status != 0 { //为什么只取第一条查询到的信息,有多条信息如何处理
The text was updated successfully, but these errors were encountered:
_, err := Ormer().Raw("SELECT id,status FROM alert WHERE rule_id =? AND labels=? AND fired_at=?", a.ruleId, a.label, a.firedAt).QueryRows(&queryres),
按照这种查询方式,rule_id, labels,和 fired_at都要同时满足的情况,只可能查出一条数据吧,为什么queryres要用数组呢
_, err := Ormer().Raw("SELECT id,status FROM alert WHERE rule_id =? AND labels=? AND fired_at=?", a.ruleId, a.label, a.firedAt).QueryRows(&queryres)
if err == nil {
if len(queryres) > 0 {
// alert has been triggered by post requests before
------> if queryres[0].Status != 0 { //为什么只取第一条查询到的信息,有多条信息如何处理
The text was updated successfully, but these errors were encountered: