diff --git a/pkg/models/user.go b/pkg/models/user.go index c1853c1..b6c52ee 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -269,7 +269,7 @@ func SearchUsers(user *User, search *UserSearch, pager *Pagination) ([]*User, er if search.Username != "" { ilike := "%" + strings.TrimSpace(strings.ToLower(search.Username)) + "%" - wheres = append(wheres, "username LIKE ? OR name ILIKE ?") + wheres = append(wheres, "(username LIKE ? OR name ILIKE ?)") placeholders = append(placeholders, ilike, ilike) }