mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
pending customer po grouped by customer
This commit is contained in:
@@ -94,11 +94,13 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
$bookings = Booking::where('admin_status', 6)->where(function($q){
|
||||
$q->WhereDoesntHave('invoice')->WhereDoesntHave('purchaseOrder');
|
||||
})->get();
|
||||
|
||||
$customers = $bookings->groupBy(function($item) {
|
||||
return $item->user_id;
|
||||
})->sortByDesc(function($item){
|
||||
return count($item);
|
||||
}, SORT_NUMERIC);
|
||||
echo "<h1>Total Customers: <b>".count($customers)."</b></h1>";
|
||||
echo "<h1>Total Po Pending Customer Update: <b>".count($bookings)."</b></h1>";
|
||||
foreach ($customers as $customer => $bookings) {
|
||||
echo "<h3>".$bookings[0]->user->marking."(".count($bookings).")</h3><br>";
|
||||
|
||||
Reference in New Issue
Block a user