srp admin controller

This commit is contained in:
2019-07-03 19:34:22 -05:00
parent 821e4d7a87
commit a8e39e3125

View File

@@ -111,8 +111,8 @@ class SRPAdminController extends Controller
public function displayStatistics() { public function displayStatistics() {
$months = 3; $months = 3;
$barChartData = array(); $barChartData = array();
$now = Carbon::now(); $now = Carbon::now()->toFormattedString();
$previous = Carbon::now()->subMonths(3); $previous = Carbon::now()->subMonths(3)->toFormattedString();
//We need a function from this library rather than recreating a new library //We need a function from this library rather than recreating a new library
$srpHelper = new SRPHelper(); $srpHelper = new SRPHelper();
@@ -122,6 +122,7 @@ class SRPAdminController extends Controller
->whereBetween('created_at', [$now, $previous]) ->whereBetween('created_at', [$now, $previous])
->count(); ->count();
$pieApproved = SRPShip::where(['approved' => 'Approved']) $pieApproved = SRPShip::where(['approved' => 'Approved'])
->whereBetween('created_at', [$now, $previous])
->count(); ->count();
$pieDenied = SRPShip::where(['approved' => 'Denied']) $pieDenied = SRPShip::where(['approved' => 'Denied'])
->whereBetween('created_at', [$now, $previous]) ->whereBetween('created_at', [$now, $previous])