fix: update GetUserByPhone
This commit is contained in:
parent
fcc08859dc
commit
ae2049c53e
|
|
@ -22,7 +22,14 @@ public partial class MongoRepository
|
|||
return null;
|
||||
}
|
||||
|
||||
phoneSecond = phone.StartsWith("+86") ? phone.Replace("+86", "") : $"+86{phone}";
|
||||
if (regionCode == "CN")
|
||||
{
|
||||
phoneSecond = (phone ?? "").StartsWith("+86") ? (phone ?? "").Replace("+86", "") : ($"+86{phone ?? ""}");
|
||||
}
|
||||
else
|
||||
{
|
||||
phoneSecond = (phone ?? "").Substring(regionCode == "US" ? 2 : 3);
|
||||
}
|
||||
|
||||
var user = _dc.Users.AsQueryable().FirstOrDefault(x => (x.Phone == phone || x.Phone == phoneSecond)
|
||||
&& (x.RegionCode == regionCode || string.IsNullOrWhiteSpace(x.RegionCode))
|
||||
|
|
|
|||
Loading…
Reference in a new issue