fix: SQL boolean and nullable value comparison

This commit is contained in:
Sérgio Salgado 2021-09-09 18:00:18 +01:00 committed by Josh Harvey
parent 4cb5b710f0
commit c74835659b

View file

@ -75,7 +75,8 @@ function customerHistory (customerId, thresholdDays) {
FROM cash_out_txs txOut FROM cash_out_txs txOut
WHERE txOut.customer_id = $1 WHERE txOut.customer_id = $1
AND txOut.created > now() - interval $2 AND txOut.created > now() - interval $2
AND (timedout = true OR error_code != 'operatorCancel') AND timedout IS false
AND error_code IS DISTINCT FROM 'operatorCancel'
AND fiat > 0 AND fiat > 0
ORDER BY created;` ORDER BY created;`