fix: wrong condition

This commit is contained in:
Methapon2001 2024-12-20 13:42:47 +07:00
parent c399cd26df
commit b5cdb24228

View file

@ -58,18 +58,21 @@ export class InvoiceController extends Controller {
prisma.invoice.count({ prisma.invoice.count({
where: { where: {
...where, ...where,
payment: { paymentStatus: { not: PaymentStatus.PaymentSuccess } }, payment: { paymentStatus: PaymentStatus.PaymentSuccess },
}, },
}), }),
prisma.invoice.count({ prisma.invoice.count({
where: { where: {
...where, ...where,
payment: { paymentStatus: PaymentStatus.PaymentSuccess }, payment: { paymentStatus: { not: PaymentStatus.PaymentSuccess } },
}, },
}), }),
]); ]);
return { pay, notPay }; return {
[PaymentStatus.PaymentSuccess]: pay,
[PaymentStatus.PaymentWait]: notPay,
};
} }
@Get() @Get()