Merge branch 'master' into lida_Dev

This commit is contained in:
AnonymousDotNet 2024-11-20 17:43:19 +08:00
commit 46b3299d27

View file

@ -11,9 +11,21 @@ public partial class FileRepository
return Users.FirstOrDefault(x => x.Email == email.ToLower());
}
public User? GetUserByPhone(string phone)
public User? GetUserByPhone(string phone, string? role = null, string regionCode = "CN")
{
return Users.FirstOrDefault(x => x.Phone == phone);
var query = Users.Where(x => x.Phone == phone);
if (!string.IsNullOrEmpty(role))
{
query = query.Where(x => x.Role == role);
}
if (!string.IsNullOrEmpty(regionCode))
{
query = query.Where(x => x.RegionCode == regionCode);
}
return query.FirstOrDefault();
}
public User? GetAffiliateUserByPhone(string phone)