diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 4ffb1434..5cee1457 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -234,11 +234,27 @@ class BookingController extends Controller $user = Auth::user(); $bookings = Booking::select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status') - ->where('admin_status', '=', '6') - ->orwhere('admin_status', '=', '7') + + ->where(function ($query) { + $query->where('admin_status', '=', '6') + ->orwhere('term', '=', 'x2_cash') + ->orwhere('term', '=', 'x2_cheque') + ->orwhere('term', '=', 'x2_ba'); + }) + + ->orWhere(function ($query) { + $query->where('admin_status', '=', '7') + ->orwhere('term', '=', 'x1_cash') + ->orwhere('term', '=', 'x1_cheque') + ->orwhere('term', '=', 'x1_ba'); + }) + + ->orderby('updated_at','desc') ->paginate(10); + + // reformat to fit frontend structure foreach ($bookings as $booking) { // set timeout