Merge pull request 'Search by phone number' (#2) from customer-search into main

Reviewed-on: https://git.altru.id/Enaaklo-Pos/enaklo-pos-backend/pulls/2
This commit is contained in:
juanda 2024-12-23 08:02:45 +00:00
commit 7931f884ee

View File

@ -138,7 +138,7 @@ func (b *UserRepository) GetAllCustomer(ctx context.Context, req entity.Customer
Where("users.user_type = 'CUSTOMER'") Where("users.user_type = 'CUSTOMER'")
if req.Search != "" { if req.Search != "" {
query = query.Where("users.name ILIKE ? or users.email ILIKE ? or r.role_name ILIKE ? or b.name ILIKE ? ", "%"+req.Search+"%", "%"+req.Search+"%", "%"+req.Search+"%", "%"+req.Search+"%") query = query.Where("users.name ILIKE ? or users.email ILIKE ? or users.phone_number ILIKE ? or r.role_name ILIKE ? or b.name ILIKE ?", "%"+req.Search+"%", "%"+req.Search+"%", "%"+req.Search+"%", "%"+req.Search+"%", "%"+req.Search+"%")
} }
if req.Name != "" { if req.Name != "" {