feat: support e164 phone number in GetUserByPhone() (#4099)

This commit is contained in:
DacongDA
2025-08-19 02:19:15 +08:00
committed by GitHub
parent 83df077a02
commit eda742a848
3 changed files with 20 additions and 1 deletions

View File

@@ -510,6 +510,8 @@ func GetUserByPhone(owner string, phone string) (*User, error) {
return nil, nil
}
phone = util.GetSeperatedPhone(phone)
user := User{Owner: owner, Phone: phone}
existed, err := ormer.Engine.Get(&user)
if err != nil {
@@ -528,6 +530,8 @@ func GetUserByPhoneOnly(phone string) (*User, error) {
return nil, nil
}
phone = util.GetSeperatedPhone(phone)
user := User{Phone: phone}
existed, err := ormer.Engine.Get(&user)
if err != nil {