mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-29 01:04:21 +00:00
x1 and x2 reports
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
@@ -58,12 +56,6 @@ class Handler extends ExceptionHandler
|
||||
], 404);
|
||||
}
|
||||
|
||||
if ($exception instanceof AuthorizationException) {
|
||||
return response()->json([
|
||||
'error' => 'Resource not found'
|
||||
], 404);
|
||||
}
|
||||
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-1
@@ -21,7 +21,12 @@ Route::get('/', 'WelcomeController@index');
|
||||
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset');
|
||||
|
||||
Route::group(['middleware' => ['role:admin']], function() {
|
||||
Route::group(function() {
|
||||
|
||||
if(Auth()::user()->role !== 'admin'){
|
||||
return redirect('/');
|
||||
}
|
||||
|
||||
Route::get('/report/x1', function(){
|
||||
$bookings = Booking::where('admin_status', '>=', 3)->where('term', 'like', 'x1_%')->where('is_cancel', false)->where('user_id', '!=', 1)->get();
|
||||
$months = $bookings->groupBy(function($item) {
|
||||
@@ -41,6 +46,7 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Route::get('/report/x2', function(){
|
||||
$bookings = Booking::where('admin_status', '>=', 3)->where('term', 'like', 'x2_%')->where('is_cancel', false)->where('user_id', '!=', 1)->get();
|
||||
$months = $bookings->groupBy(function($item) {
|
||||
@@ -60,6 +66,7 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Route::get('/po-approval', function(){
|
||||
$approvedInvoices = InvoiceStatuses::where('status', 'approve')->distinct()->get(['invoice_id'])->pluck('invoice_id');
|
||||
$pendingChangeInvoices = InvoiceStatuses::where('status', 'request_change')->distinct()->get(['invoice_id'])->pluck('invoice_id');
|
||||
|
||||
Reference in New Issue
Block a user