This commit is contained in:
yumoqing 2026-05-14 17:45:56 +08:00
parent b2e4b03b82
commit 202fe6b578

View File

@ -19,16 +19,10 @@ async def all_my_accounts(request):
b.id,
a.name,
b.balance_at,
case when c.balance is null then 0.00 else c.balance end as balance
b.balance
from
subject a,
account b left join
(
select a.*
from acc_balance a,
(select accountid, max(acc_date) max_date from acc_balance group by accountid) b
where a.accountid=b.accountid and a.acc_date=b.max_date
) c on c.accountid = b.id
account b
where b.subjectid = a.id
and b.orgid = ${orgid}$
"""