|
@@ -73,7 +73,7 @@ func (*userDao) GetByIds(userIds []int64) ([]model.User, error) { |
|
|
func (*userDao) Search(key string, masterId int64) ([]model.User, error) { |
|
|
func (*userDao) Search(key string, masterId int64) ([]model.User, error) { |
|
|
var users []model.User |
|
|
var users []model.User |
|
|
key = "%" + key + "%" |
|
|
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 { |
|
|
if err != nil { |
|
|
return nil, gerrors.WrapError(err) |
|
|
return nil, gerrors.WrapError(err) |
|
|
} |
|
|
} |
|
|