From 15a886eac057cb93da050ec83388491a41b7086a Mon Sep 17 00:00:00 2001 From: ilham Date: Mon, 3 Jan 2022 12:47:31 +0700 Subject: [PATCH] fix: transaction for dashboard --- src/transaction/transaction.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/transaction/transaction.service.ts b/src/transaction/transaction.service.ts index 62951db..f730009 100644 --- a/src/transaction/transaction.service.ts +++ b/src/transaction/transaction.service.ts @@ -1058,7 +1058,9 @@ export class TransactionService { const baseQuery = this.transactionRepository .createQueryBuilder('transactions') .innerJoin('transactions.product_price', 'product_price') - .where('transactions.type = 1 and partner_trx_id is NULL'); + .where( + 'transactions.type = 1 and partner_trx_id is NULL and transactions.status = 1', + ); const data = await baseQuery .select('SUM(transactions.amount) as total_amount') @@ -1088,7 +1090,9 @@ export class TransactionService { const baseQuery = this.transactionRepository .createQueryBuilder('transactions') .innerJoin('transactions.product_price', 'product_price') - .where('transactions.type = 1 and partner_trx_id is not NULL'); + .where( + 'transactions.type = 1 and partner_trx_id is not NULL and transactions.status = 1', + ); const data = await baseQuery .select('SUM(transactions.amount) as total_amount')