|
|
@@ -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) |
|
|
|
} |
|
|
|