From 9aa1368d68c89d66b735541d1c4d95bddd541135 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 12 Dec 2022 22:45:38 +0800 Subject: [PATCH] udpate search user --- internal/business/domain/user/repo/user_dao.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/business/domain/user/repo/user_dao.go b/internal/business/domain/user/repo/user_dao.go index 2ba2289..2dc5800 100644 --- a/internal/business/domain/user/repo/user_dao.go +++ b/internal/business/domain/user/repo/user_dao.go @@ -73,7 +73,7 @@ func (*userDao) GetByIds(userIds []int64) ([]model.User, error) { func (*userDao) Search(key string, masterId int64) ([]model.User, error) { var users []model.User key = "%" + key + "%" - err := db.DB.Where("phone_number like ? or nickname like ? and master_id = ?", key, key, masterId).Find(&users).Error + err := db.DB.Where("phone_number like ? or nickname like ? ", key, key).Where("master_id = ?", masterId).Find(&users).Error if err != nil { return nil, gerrors.WrapError(err) }