@extends('layouts.admin', ['title' => 'إدارة العملاء']) @php $summary = $data['summary']; $customers = $data['customers']; $filters = $data['filters']; $fmt = fn ($minor) => number_format(($minor ?? 0) / 100, 2).' ج.م'; $statusLabels = ['active' => 'نشط', 'suspended' => 'موقوف', 'frozen' => 'مجمد', 'banned' => 'محظور', 'deleted' => 'محذوف']; $tierLabels = ['general' => 'عام', 'silver' => 'سلفر', 'vip_silver' => 'VIP فضي', 'merchant_gold' => 'تاجر ذهبي']; @endphp @section('content')

عملاء المتجر

كروت مختصرة لكل عميل، واضغط على الملف الشخصي لفتح كل تفاصيله.

@csrf
@forelse($customers as $customer) @php $name = $customer->display_name ?: $customer->name; $statusClass = match($customer->status) { 'active' => 'green', 'suspended', 'frozen' => 'orange', default => 'red' }; @endphp
{{ mb_strtoupper(mb_substr($name, 0, 1)) }} {{ $statusLabels[$customer->status] ?? $customer->status }}

{{ $name }}

ID: {{ $customer->public_id ?: $customer->id }}

الإنفاق{{ $fmt($customer->total_spent_minor ?: $customer->total_spent_range) }}
الطلبات{{ number_format($customer->orders_count) }}
الرصيد{{ $fmt($customer->wallet?->balance_minor) }}
الترقية{{ $tierLabels[$customer->customer_tier ?? 'general'] ?? 'عام' }}{{ $customer->wallet?->is_frozen ? 'محفظة مجمدة' : 'محفظة نشطة' }}
الملف الشخصي
@empty
لا يوجد عملاء مطابقين للفلاتر.
@endforelse
{{ $customers->links() }}
@endsection