fix: remove duplicate column
This commit is contained in:
parent
bbde0fc2b6
commit
c48d24ed19
1 changed files with 1 additions and 1 deletions
|
|
@ -491,7 +491,7 @@ function getCustomersList (phone = null, name = null, address = null, id = null)
|
||||||
row_number() OVER (partition by c.id order by t.created desc) AS rn,
|
row_number() OVER (partition by c.id order by t.created desc) AS rn,
|
||||||
coalesce(sum(case when error_code is null or error_code not in ($1^) then t.fiat else 0 end) over (partition by c.id), 0) as total_spent,
|
coalesce(sum(case when error_code is null or error_code not in ($1^) then t.fiat else 0 end) over (partition by c.id), 0) as total_spent,
|
||||||
sum(CASE WHEN t.id IS NOT NULL THEN 1 ELSE 0 END) OVER (partition by c.id) AS total_txs,
|
sum(CASE WHEN t.id IS NOT NULL THEN 1 ELSE 0 END) OVER (partition by c.id) AS total_txs,
|
||||||
coalesce(sum(t.fiat) OVER (partition by c.id), 0) AS total_spent, ccf.custom_fields
|
ccf.custom_fields
|
||||||
FROM customers c LEFT OUTER JOIN (
|
FROM customers c LEFT OUTER JOIN (
|
||||||
SELECT 'cashIn' AS tx_class, id, fiat, fiat_code, created, customer_id, error_code
|
SELECT 'cashIn' AS tx_class, id, fiat, fiat_code, created, customer_id, error_code
|
||||||
FROM cash_in_txs WHERE send_confirmed = true UNION
|
FROM cash_in_txs WHERE send_confirmed = true UNION
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue