From c309ff017cf5b262bc805655b7740896930fcace Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 3 Aug 2023 11:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/db_user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) }