mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-24 06:44:20 +00:00
Merge branch 'admin_Completed_Order' into 'master'
Admin completed order See merge request CIEFWorldwideSdnBhd/exchange!124
This commit is contained in:
@@ -22,19 +22,30 @@ class BookingController extends Controller
|
||||
{
|
||||
|
||||
public function index(){
|
||||
\DB::connection()->enableQueryLog();
|
||||
$user = Auth::user();
|
||||
$bookings = Booking::select('user_id', 'id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where(function ($query) {
|
||||
$query->where('status', '=', '6')
|
||||
->orwhere('status', '=', '4')
|
||||
->orwhere('status', '=', '3')
|
||||
->orwhere('status', '=', '2')
|
||||
->orwhere('status', '=', '1');
|
||||
})
|
||||
$query->where('status', '<', '5')
|
||||
->where(function ($query) {
|
||||
$query->where('term', '=', 'x2_cheque')
|
||||
->orwhere('term', '=', 'x2_ba')
|
||||
->orwhere('term', '=', 'x2_cash');
|
||||
});
|
||||
})
|
||||
->orwhere(function ($query) {
|
||||
$query->where('status', '<', '7')
|
||||
->where(function ($query) {
|
||||
$query->where('term', '=', 'x1_cheque')
|
||||
->orwhere('term', '=', 'x1_ba')
|
||||
->orwhere('term', '=', 'x1_cash');
|
||||
});
|
||||
})
|
||||
->orderby('updated_at','desc')
|
||||
->paginate(10);
|
||||
|
||||
$queries = \DB::getQueryLog();
|
||||
//return print_r($queries);
|
||||
// reformat to fit frontend structure
|
||||
foreach ($bookings as $booking) {
|
||||
// set timeout
|
||||
@@ -94,8 +105,18 @@ class BookingController extends Controller
|
||||
$user = Auth::user();
|
||||
$bookings = Booking::select('user_id', 'id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id', Auth::user()->id)
|
||||
->where ( "status" ,'=','6')
|
||||
->orWhere( "status" ,'=','5')
|
||||
->where('status', '=', '5')
|
||||
->where(function ($query) {
|
||||
$query->where('term', '=', 'x2_cash')
|
||||
->orwhere('term', '=', 'x2_cheque')
|
||||
->orwhere('term', '=', 'x2_ba');
|
||||
})
|
||||
->orwhere('status', '=', '7')
|
||||
->where(function ($query) {
|
||||
$query->where('term', '=', 'x1_cash')
|
||||
->orwhere('term', '=', 'x1_cheque')
|
||||
->orwhere('term', '=', 'x1_ba');
|
||||
})
|
||||
->orderby('updated_at','desc')
|
||||
->paginate(10);
|
||||
|
||||
@@ -161,11 +182,14 @@ class BookingController extends Controller
|
||||
public function adminIndex(){
|
||||
$user = Auth::user();
|
||||
$bookings = Booking::select('user_id', 'id', 'created_at', 'admin_status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->where('admin_status', '=', '5')
|
||||
->orwhere('admin_status', '=', '4')
|
||||
->orwhere('admin_status', '=', '3')
|
||||
->orwhere('admin_status', '=', '2')
|
||||
->orwhere('admin_status', '=', '1')
|
||||
->where('admin_status', '<', '6')
|
||||
->orwhere(function ($query) {
|
||||
$query->where('admin_status', '=', '6')
|
||||
->where('term', '!=', 'x2_cheque')
|
||||
->where('term', '!=', 'x2_ba')
|
||||
->where('term', '!=', 'x2_cash');
|
||||
})
|
||||
|
||||
->orderby('updated_at','desc')
|
||||
->paginate(10);
|
||||
|
||||
@@ -234,12 +258,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')
|
||||
->orwhere('admin_status', '=', '7')
|
||||
->where(function ($query) {
|
||||
$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
|
||||
|
||||
Generated
+6165
-9165
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -25,7 +25,7 @@
|
||||
"jquery": "^3.3.1",
|
||||
"js-cookie": "^2.2.0",
|
||||
"laravel-echo": "^1.4.0",
|
||||
"npm": "^6.0.1",
|
||||
"npm": "^6.4.0",
|
||||
"popper.js": "^1.14.1",
|
||||
"pusher-js": "^4.3.0",
|
||||
"sweetalert2": "^7.15.1",
|
||||
|
||||
Reference in New Issue
Block a user