diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index a4ccf7a1..0fa13b3d 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -190,12 +190,23 @@ class BookingController extends Controller public function adminIndex(?string $userId = null){ $user = Auth::user(); $bookings = Booking::UserBooking($userId)->select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status') - ->where('admin_status', '<', '6') - ->orwhere(function ($query) { - $query->where('admin_status', '=', '6') - ->where('term', '!=', 'x2_cheque') - ->where('term', '!=', 'x2_ba') - ->where('term', '!=', 'x2_cash'); + ->where(function ($query) { + $query->where(function ($query) { + $query->where('admin_status', '<', '6') + ->where(function ($query) { + $query->where('term', 'x2_cash') + ->orwhere('term', 'x2_cheque') + ->orwhere('term', 'x2_ba'); + }); + }) + ->orwhere(function ($query) { + $query->where('status', '<', '7') + ->where(function ($query) { + $query->where('term', 'x1_cash') + ->orwhere('term', 'x1_cheque') + ->orwhere('term', 'x1_ba'); + }); + }); }) ->orderby('updated_at','desc') ->paginate(30);