{{$i+1}} |
@if($booking->agent_id == 0)
TiketiGala
@else
{{ \App\Models\Agent::where(['id' => $booking->agent_id])->first()->name }}
@endif
|
@php
$fareT = \App\Models\Booking::whereDate('created_at', \Illuminate\Support\Carbon::today())
->where('agent_id', '=', $booking->agent_id)
->where('status', '>', 2)
->sum('fare');
echo $fareT;
@endphp
|
@php
$fareLD = \App\Models\Booking::whereDate('created_at', \Illuminate\Support\Carbon::yesterday()->toDateString())
->where('agent_id', '=', $booking->agent_id)
->where('status', '>', 2)
->sum('fare');
echo $fareLD;
@endphp
|
@php
$fareW = \App\Models\Booking::whereBetween('created_at', [\Illuminate\Support\Carbon::now()->startOfWeek(), \Illuminate\Support\Carbon::now()->endOfWeek()])
->where('agent_id', '=', $booking->agent_id)
->where('status', '>', 2)
->sum('fare');
echo $fareW;
@endphp
|
@php
$previous_week = strtotime("-1 week +1 day");
$start_week = strtotime("last sunday midnight",$previous_week);
$end_week = strtotime("next saturday",$start_week);
$start_week = date("Y-m-d",$start_week);
$end_week = date("Y-m-d",$end_week);
$fareLW = \App\Models\Booking::whereBetween('created_at', [$start_week, $end_week])
->where('agent_id', '=', $booking->agent_id)
->where('status', '>', 2)
->sum('fare');
echo $fareLW;
@endphp
|
@php
$fareM = \App\Models\Booking::whereMonth('created_at', date('m'))
->where('agent_id', '=', $booking->agent_id)
->where('status', '>', 2)
->sum('fare');
echo $fareM;
@endphp
|
@php
$fareLM = \App\Models\Booking::whereMonth('created_at', '=', \Illuminate\Support\Carbon::now()->subMonth()->month)
->where('agent_id', '=', $booking->agent_id)
->where('status', '>', 2)
->sum('fare');
echo $fareLM;
@endphp
|
@php
$fareW = \App\Models\Booking::whereYear('created_at', date('Y'))
->where('agent_id', '=', $booking->agent_id)
->where('status', '>', 2)
->sum('fare');
echo $fareW;
@endphp
|
@php
$fareW = \App\Models\Booking::whereYear('created_at', date('Y', strtotime('-1 year')))
->where('agent_id', '=', $booking->agent_id)
->where('status', '>', 2)
->sum('fare');
echo $fareW;
@endphp
|
@endforeach