fix: use correct state column for AWAITING_PAYMENT orders
- Fix column o.payment_status does not exist error - orders_orders uses 'state' column, not 'payment_status' - Changed all 3 affected queries
This commit is contained in:
@@ -15,7 +15,7 @@ export function notificationsRoutes(fastify: FastifyInstance, pool: Pool) {
|
||||
AND updated_at < NOW() - INTERVAL '24 hours'
|
||||
) AS shipped_24h,
|
||||
COUNT(*) FILTER (
|
||||
WHERE payment_status = 'AWAITING'
|
||||
WHERE state = 'AWAITING_PAYMENT'
|
||||
AND state = 'PENDING'
|
||||
) AS awaiting_payment
|
||||
FROM pos_orders
|
||||
|
||||
Reference in New Issue
Block a user