diff --git a/app/db/db_user.go b/app/db/db_user.go index 3e6196f..0da8d54 100644 --- a/app/db/db_user.go +++ b/app/db/db_user.go @@ -44,7 +44,7 @@ func UserInByUIDByLevel(Db *xorm.Engine, ids []int, levelID interface{}) (*[]mod // UserFindByMobile search user by mobile func UserFindByMobile(Db *xorm.Engine, mobile string) (*model.User, error) { var m model.User - if has, err := Db.Where("(phone = ? OR uid = ?) AND delete_at = 0", mobile, mobile). + if has, err := Db.Where("phone LIKE ? AND delete_at = 0", "%"+mobile). Get(&m); err != nil || has == false { return nil, logx.Warn(err) }