show active customers in the report

This commit is contained in:
omair saleh
2021-01-09 11:12:18 +08:00
parent c6da00e1d5
commit 0588f240a9
+1 -1
View File
@@ -29,7 +29,7 @@ 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('Y'))->get();
$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){