fix(admin): resolve incorrect crypto balance calculation fallback displaying fiat amount
This commit is contained in:
@@ -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
|
||||
`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user