Skip to content

Commit

Permalink
fix(rbac): fixed sql syntax issue on QueryUsersCount
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlangzi committed Apr 20, 2024
1 parent 9a064d5 commit 995e6fb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions auth_rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ func (a *Auth) QueryUsersCount(ctx context.Context, where *sqle.WhereBuilder) (i
query := sqle.NewQuery[User](a.db)

b := a.createBuilder().
Select("<prefix>user").
WithWhere(where).
End()
Select("<prefix>user", "count(id) as c")

b.WithWhere(where)

total, err := query.Count(ctx, b)
if err != nil {
a.logger.Error("auth: QueryUserCount",
Expand Down

0 comments on commit 995e6fb

Please sign in to comment.