From 42c99636d412b0c366f8917a788b9fd5979f9445 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Mon, 7 Dec 2020 11:56:55 +0800 Subject: [PATCH] pending customer po grouped by customer --- routes/web.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index ea49b102..6a35c37e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -96,9 +96,9 @@ Route::group(['middleware' => ['role:admin']], function() { })->get(); $customers = $bookings->groupBy(function($item) { return $item->user_id; - })->sortBy(function($item){ + })->sortByDesc(function($item){ return count($item); - }); + }, SORT_NUMERIC); echo "

Total Po Pending Customer Update: ".count($bookings)."

"; foreach ($customers as $customer => $bookings) { echo "

".$bookings[0]->user->marking."(".count($bookings).")


";