@extends('layouts.app') @section('title', 'إحصائيات البائعين') @section('page_heading', 'إحصائيات البائعين') @section('content') @include('dashboard.statistics.partials.nav') @php $rankedUsers = collect($usersData)->map(function($u) { $u['score'] = $u['salesCount'] + $u['reservationsCount'] + $u['fittingAppointmentsCount'] + $u['deliveryAppointmentsCount']; return $u; })->sortByDesc('score')->values(); $activeCount = $rankedUsers->filter(fn($u) => $u['score'] > 0)->count(); $totalServiceOps = $totalFittingAppointmentsCount + $totalDeliveryAppointmentsCount; @endphp {{-- Filter --}}
{{-- KPIs --}}| {{ $h }} | @endforeach|||||||||
|---|---|---|---|---|---|---|---|---|---|
|
{{ $idx+1 }}
|
{{ mb_substr($ud['user']->name,0,1) }}
{{ $ud['user']->name }}
{{ $ud['user']->email }}
|
{{ $ud['salesCount'] }} |
{{ number_format($ud['salesTotalValue'],2) }}
ج.م
|
{{ $ud['reservationsCount'] }} |
{{ number_format($ud['reservationsTotalValue'],2) }}
ج.م
|
{{ number_format($ud['reservationsDepositSum'],2) }}
ج.م
|
{{ $ud['fittingAppointmentsCount'] }} | {{ $ud['deliveryAppointmentsCount'] }} |
{{ $ud['score'] }}
|
| الإجمالي | {{ $totalSalesCount }} | {{ number_format($totalSalesValue,2) }} | {{ $totalReservationsCount }} | {{ number_format($totalReservationsValue,2) }} | {{ number_format($totalReservationsDeposit,2) }} | {{ $totalFittingAppointmentsCount }} | {{ $totalDeliveryAppointmentsCount }} | {{ $rankedUsers->sum('score') }} | |