@extends('layouts.app') @section('title') {{ $title }} @endsection @section('title2') {{ $title2 }} @endsection @section('breadcrumbs') @endsection @section('content')
Total Data
Data ini di hitung per hari ini, dan di kalkulasikan per 100
Pembeli
Produk
Transaksi
Total pendapatan minggu ini

Rp. {{ number_format($weeklyIncomeBersih ?? 0, 0, ',', '.') }}

Pendapatan minggu ini

Pendapatan hari ini

{{ 'Rp ' .number_format(\App\Models\Transaction::where('status', 'success')->whereDate('created_at', now())->sum('amount'),0,',','.') }}

Transaksi hari ini

{{ \App\Models\Transaction::whereDate('created_at', now())->count() }}

Total pendapatan

{{ 'Rp ' .number_format(\App\Models\Transaction::where('status', 'success')->sum('amount'),0,',','.') }}

Transaksi selesai

{{ \App\Models\Transaction::where('status', 'success')->count() }}

Transaction Statistics
Catatan / Notes
Top Kasir
@foreach ($topSellers as $index => $topSeller)

{{ $index + 1 }}.

...
{{ $topSeller->seller->shop_name }}
{{ \Illuminate\Support\Str::limit($topSeller->seller->name, 20, '...') }}

Rp. {{ number_format($topSeller->total_sales ?? 0, 0, ',', '.') }}

@endforeach
Top Pembeli
@foreach ($topBuyers as $index => $topBuyer)

{{ $index + 1 }}.

...
{{ $topBuyer->user->username ?? 'Pengguna tidak ditemukan' }}
{{ \Illuminate\Support\Str::limit($topBuyer->user->name ?? 'Pengguna tidak ditemukan', 20, '...') }}

Rp. {{ number_format($topBuyer->total_sales ?? 0, 0, ',', '.') }}

@endforeach
Top Produk
@foreach ($topSellingProducts as $index => $topSellingProduct) @php $colors = '#007bff'; if ($index == 0) { $colors = '#ffd700'; } elseif ($index == 1) { $colors = '#C0C0C0'; } elseif ($index == 2) { $colors = '#CE8946'; } else { $color = '#007bff'; } @endphp

{{ $index + 1 }}.

...
Total Terjual : {{ $topSellingProduct['total_quantity'] }} {{ $topSellingProduct['products']->unit }}
{{ \Illuminate\Support\Str::limit($topSellingProduct['products']->name, 35, '...') }}
@endforeach
@endsection @section('modal') @endsection @section('scripts') @endsection