export pending order should not export order with refund in progress

This commit is contained in:
JiaSheng
2024-03-07 15:41:21 +08:00
parent 7030041246
commit b0e3467fbe
+5 -1
View File
@@ -386,7 +386,11 @@ Route::get('/segments', function (Request $request) {
})->name('segments');
Route::get('/pending_orders', function(){
$payments = Transaction::where('type', TransactionType::PAYMENT)->where('owner_type', Booking::class)->whereIn('status', [ApprovalStatus::APPROVED])->get();
$payments = Transaction::where('type', TransactionType::PAYMENT)->where('owner_type', Booking::class)->whereIn('status', [ApprovalStatus::APPROVED])
->whereDoesntHave('transactions', function ($query) {
return $query->where('type', TransactionType::REFUND)->whereIn('status', [ApprovalStatus::PENDING_SUBMISSION, ApprovalStatus::PENDING_VERIFICATION]);
})
->get();
echo '<table>';
$i = 0;