Search by phone number

This commit is contained in:
Juanda Ritonga 2024-12-23 12:09:29 +07:00
parent 8be33d521f
commit e13793ea6a

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 != "" {