Only fetch paid orders
This commit is contained in:
parent
b82e5de63c
commit
b2d8c089c9
|
@ -138,7 +138,8 @@ func (db *DB) FetchMarketOrders(marketId int64, orders *[]Order) error {
|
||||||
"SELECT o.id, share_id, o.pubkey, o.side, o.quantity, o.price, o.invoice_id, o.created_at, s.description, s.market_id " +
|
"SELECT o.id, share_id, o.pubkey, o.side, o.quantity, o.price, o.invoice_id, o.created_at, s.description, s.market_id " +
|
||||||
"FROM orders o " +
|
"FROM orders o " +
|
||||||
"JOIN shares s ON o.share_id = s.id " +
|
"JOIN shares s ON o.share_id = s.id " +
|
||||||
"WHERE s.market_id = $1 " +
|
"JOIN invoices i ON i.id = o.invoice_id " +
|
||||||
|
"WHERE s.market_id = $1 AND i.confirmed_at IS NOT NULL " +
|
||||||
"ORDER BY o.created_at DESC"
|
"ORDER BY o.created_at DESC"
|
||||||
rows, err := db.Query(query, marketId)
|
rows, err := db.Query(query, marketId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue