fixAdminCommit

This commit is contained in:
lonetrinity
2018-08-17 11:12:15 +08:00
parent 7d1155651b
commit 249894d5b2
+12 -20
View File
@@ -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