fix(admin): resolve incorrect crypto balance calculation fallback displaying fiat amount

This commit is contained in:
mstfyldz
2026-03-14 18:09:18 +03:00
parent 8800454b60
commit a0e787e03c
17 changed files with 525 additions and 22 deletions

View File

@@ -57,9 +57,9 @@ export async function GET() {
merchant_id,
COALESCE(paid_network, 'SİSTEM') as network,
COALESCE(paid_token, 'TRY') as token,
SUM(COALESCE(paid_amount_crypto, amount)) as amount
SUM(CAST(COALESCE(paid_amount_crypto, '0') AS numeric)) as amount
FROM transactions
WHERE status = 'succeeded'
WHERE status = 'succeeded' AND paid_network IS NOT NULL
GROUP BY merchant_id, paid_network, paid_token
`);