show total in x1 report

This commit is contained in:
omair saleh
2021-02-08 19:15:37 +08:00
parent e1547f986a
commit f292c93545
+2 -1
View File
@@ -24,7 +24,7 @@ Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('p
Route::group(['middleware' => ['role:admin']], function() {
Route::get('/report/x1', function(){
$bookings = Booking::where('admin_status', '>=', 3)->where('term', 'like', 'x1_%')->where('is_cancel', false)->where('user_id', '!=', 1)->get();
echo "Total: ".$bookings->sum('bia');
echo "<h1 style='color: green;'>Total: ".$bookings->sum('bia')."</h1>";
$months = $bookings->groupBy(function($item) {
return $item->created_at->format('Y-m');
});
@@ -50,6 +50,7 @@ Route::group(['middleware' => ['role:admin']], function() {
Route::get('/report/x2', function(){
$bookings = Booking::where('admin_status', '>=', 3)->where('term', 'like', 'x2_%')->where('is_cancel', false)->where('user_id', '!=', 1)->get();
echo "<h1 style='color: green;'>Total: ".$bookings->sum('bia')."</h1>";
$months = $bookings->groupBy(function($item) {
return $item->created_at->format('Y-m');
});