- Son 7 gün toplamı
-
{{ number_format($branch->last_seven_days_total, 2, ',', '.') }}
₺
@foreach ($branch->getCachedLastSevenDaysSales() as $day)
-
{{ date('d.m', strtotime($day->starting)) }}
{{ \Carbon\Carbon::parse($day->starting)->locale('tr')->translatedFormat('l') }}
-
receipt_long
@php
$selectedDate = $day->day; // Example date
$cacheKey = "branch_{$branch->id}_sales_count_{$selectedDate}";
$salesCount = Cache::remember($cacheKey, 1440, function () use (
$branch,
$selectedDate,
) {
return $branch->salesByDate($selectedDate)->count();
});
@endphp
{{ $salesCount == 0 ? '' : $salesCount }} -
{{ number_format($day->net_sales, 2, ',', '.') }}
₺
@endforeach