👔 Adjust lookup account logic

This commit is contained in:
2025-11-30 17:20:20 +08:00
parent 46717e39a7
commit cb62df81e2

View File

@@ -58,7 +58,9 @@ public class AccountService(
if (account is not null) return account;
var contact = await db.AccountContacts
.Where(c => c.Content == probe)
.Where(c => c.Type == Shared.Models.AccountContactType.Email ||
c.Type == Shared.Models.AccountContactType.PhoneNumber)
.Where(c => EF.Functions.ILike(c.Content, probe))
.Include(c => c.Account)
.FirstOrDefaultAsync();
return contact?.Account;