test xorm

This commit is contained in:
UlricQin 2021-07-18 16:30:02 +08:00
parent 27daddcb72
commit 0a29fb89c4
1 changed files with 2 additions and 2 deletions

View File

@ -185,7 +185,7 @@ func AlertEventTotal(stime, etime int64, query string, status, priority int) (nu
arr := strings.Fields(query)
for i := 0; i < len(arr); i++ {
qarg := "%" + arr[i] + "%"
cond = cond.And(cond.Or(builder.Like{"res_classpaths", qarg}, builder.Like{"rule_name", qarg}, builder.Like{"tags", qarg}))
cond = cond.Or(builder.Like{"res_classpaths", qarg}, builder.Like{"rule_name", qarg}, builder.Like{"tags", qarg})
}
}
@ -216,7 +216,7 @@ func AlertEventGets(stime, etime int64, query string, status, priority int, limi
arr := strings.Fields(query)
for i := 0; i < len(arr); i++ {
qarg := "%" + arr[i] + "%"
cond = cond.And(cond.Or(builder.Like{"res_classpaths", qarg}, builder.Like{"rule_name", qarg}, builder.Like{"tags", qarg}))
cond = cond.Or(builder.Like{"res_classpaths", qarg}, builder.Like{"rule_name", qarg}, builder.Like{"tags", qarg})
}
}