Commit 7d814c33 authored by qiuqunfeng's avatar qiuqunfeng
Browse files

Enhance ListListenerHistory method to support multiple LIKE conditions

- Update the ListListenerHistory method to allow querying by multiple fields using LIKE conditions, specifically for 'name', 'listener_name', and 'gateway_name'.
parent 3d7cd866
......@@ -1291,8 +1291,8 @@ func (s *wafService) ListListenerHistory(ctx context.Context, query *WafListener
if len(query.WhereEqCondition) > 0 {
db = db.Where(query.WhereEqCondition)
}
for column, val := range query.WhereLikeCondition {
db = db.Where(fmt.Sprintf("%s LIKE ?", column), GetLikeExpr(val))
for _, val := range query.WhereLikeCondition {
db = db.Where(fmt.Sprintf("%s LIKE ?", "name"), GetLikeExpr(val)).Or("%s LIKE ?", "listener_name").Or("%s LIKE ?", "gateway_name")
}
if limit > 0 && offset >= 0 {
db = db.Offset(offset).Limit(limit)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment