fix: expired column in customer transactions history

This commit is contained in:
André Sá 2021-10-13 18:21:45 +01:00
parent c819a354bc
commit 168192b708
4 changed files with 13 additions and 9 deletions

View file

@ -33,7 +33,7 @@ function batch () {
order by created desc limit $2`
const cashOutSql = `select 'cashOut' as tx_class, cash_out_txs.*,
(extract(epoch from (now() - greatest(created, confirmed_at))) * 1000) >= $2 as expired
(NOT dispense AND extract(epoch from (now() - greatest(created, confirmed_at))) >= $2) as expired
from cash_out_txs
order by created desc limit $1`
@ -51,7 +51,7 @@ function single (txId) {
where id=$2`
const cashOutSql = `select 'cashOut' as tx_class,
(extract(epoch from (now() - greatest(created, confirmed_at))) * 1000) >= $2 as expired,
(NOT dispense AND extract(epoch from (now() - greatest(created, confirmed_at))) >= $2) as expired,
cash_out_txs.*
from cash_out_txs
where id=$1`