admin user bookings

This commit is contained in:
Omair Saleh
2018-12-20 18:06:17 +08:00
parent 85e2d1f244
commit 3a34519ffa
+17 -6
View File
@@ -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);