From d9162c208264f9590cdd23136eb1a1f07910ba07 Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Fri, 28 Oct 2022 10:25:24 +0700 Subject: [PATCH] [Update] --- action.go | 5 +++++ user/handle.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/action.go b/action.go index c31feb7..8a2af38 100644 --- a/action.go +++ b/action.go @@ -74,6 +74,11 @@ func (s Service) CountAllUsers(query model.UserCountQuery) int64 { return user.Count(query) } +// CountUsersByCondition ... +func (s Service) CountUsersByCondition(cond interface{}) int64 { + return user.CountByCondition(cond) +} + // ChangeAllUsersStatus ... func (s Service) ChangeAllUsersStatus(roleID, status string) error { return user.ChangeAllUsersStatus(roleID, status) diff --git a/user/handle.go b/user/handle.go index 5adf5d7..8e7bf8a 100644 --- a/user/handle.go +++ b/user/handle.go @@ -279,6 +279,11 @@ func GetUsersByPermission(queryParams model.UserByPermissionQuery) (r model.User return } +// CountByCondition ... +func CountByCondition(filter interface{}) int64 { + return countByCondition(context.Background(), filter) +} + // Count ... func Count(queryParams model.UserCountQuery) int64 { var (