mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
show active customers in the report
This commit is contained in:
@@ -55,7 +55,12 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
});
|
||||
|
||||
foreach($months as $month => $bookings){
|
||||
$newCustomers = \App\User::whereYear('created_at', '=', Carbon::parse($month)->format('Y')) ->whereMonth('created_at', '=', Carbon::parse($month)->format('m'))->get();
|
||||
echo "<h1>".Carbon::parse($month)->format('m-Y').": <small style='color: green; font-size: larger'>".$bookings->sum('bia')." MYR</small></h1>";
|
||||
echo "<h3>New Customer: <small style='color: green; font-size: larger'>".count($newCustomers)." Customers</small></h3>";
|
||||
echo "<h3>Active Customers: <small style='color: green; font-size: larger'>".count($bookings->groupBy(function($item){
|
||||
return $item->user_id;
|
||||
}))." Customers</small></h3>";
|
||||
$days = $bookings->groupBy(function($item){
|
||||
return $item->created_at->format('Y-m-d');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user