From 249894d5b2de6430ef24816de2bf74750ff8388b Mon Sep 17 00:00:00 2001 From: lonetrinity Date: Fri, 17 Aug 2018 11:12:15 +0800 Subject: [PATCH] fixAdminCommit --- app/Http/Controllers/BookingController.php | 32 ++++++++-------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/BookingController.php b/app/Http/Controllers/BookingController.php index 1ad14f06..94b7b384 100644 --- a/app/Http/Controllers/BookingController.php +++ b/app/Http/Controllers/BookingController.php @@ -234,28 +234,20 @@ class BookingController extends Controller public function adminBookComplete(){ $user = Auth::user(); $bookings = Booking::select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status') - - + ->where('admin_status', '=', '6') ->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'); - }) - - + $query->where('term', '=', 'x2_cash') + ->orwhere('term', '=', 'x2_cheque') + ->orwhere('term', '=', 'x2_ba'); + }) + ->orwhere('admin_status', '=', '7') + ->where(function ($query) { + $query->where('term', '=', 'x1_cash') + ->orwhere('term', '=', 'x1_cheque') + ->orwhere('term', '=', 'x1_ba'); + }) ->orderby('updated_at','desc') - ->paginate(10); - - - + ->paginate(10); // reformat to fit frontend structure foreach ($bookings as $booking) { // set timeout