From 0065a8070c48c5f7d4330c7a3ac3d27f985ae5f4 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sat, 5 Dec 2020 11:39:43 +0800 Subject: [PATCH] x1 and x2 reports --- routes/web.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index 150afdda..05127e7a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,8 +27,12 @@ Route::get('/report/x1', function(){ }); foreach($months as $month => $bookings){ - dd($bookings->map(function ($row) { return $row->sum('bia'); })); - echo "

".$month."(".$bookings->map(function ($row) { return $row->sum('bia'); }).")


"; + $total = 0; + foreach ($bookings as $booking){ + $total += $booking->bia; + } + dd($total); +// echo "

".$month."(".$bookings->map(function ($row) { return $row->sum('bia'); }).")


"; $day = $bookings->groupBy(function($item){ return $item->created_at->format('Y-m-d'); });