Update Filter
This commit is contained in:
@@ -101,6 +101,10 @@ func (b *UserRepository) GetAllUsers(ctx context.Context, req entity.UserSearch)
|
||||
query = query.Where("ur.partner_id = ? ", req.PartnerID)
|
||||
}
|
||||
|
||||
if req.SiteID > 0 {
|
||||
query = query.Where("ur.site_id = ? ", req.SiteID)
|
||||
}
|
||||
|
||||
// Get the total count without applying the limit and offset.
|
||||
if err := query.Model(&entity.UserDB{}).Count(&total).Error; err != nil {
|
||||
logger.ContextLogger(ctx).Error("error when count users", zap.Error(err))
|
||||
|
||||
Reference in New Issue
Block a user