@extends('backend.p2p.layout') @section('title', __('P2P Traders')) @section('p2p_title') {{ __('Traders') }} @endsection @section('p2p_icon', 'badge-account') @php $traderTotal = method_exists($users, 'total') ? (int) $users->total() : $users->count(); $items = collect($users->items() ?? $users); $verifiedCount = $items->filter(fn ($u) => $u->isKycVerified())->count(); $suspendedCount = $items->filter(fn ($u) => $u->isP2pTradingSuspended())->count(); $tierFor = function (int $totalOrders): array { return match (true) { $totalOrders >= 1000 => ['merchant', __('Merchant')], $totalOrders >= 250 => ['gold', __('Gold')], $totalOrders >= 50 => ['silver', __('Silver')], default => ['bronze', __('Bronze')], }; }; $toneFor = function (string $seed): string { $tones = ['blue', 'green', 'amber', 'rose', 'violet', 'teal']; return $tones[abs(crc32($seed)) % count($tones)]; }; @endphp @section('p2p_action')
@endsection @section('p2p_content') @php $hasTraders = $traderTotal > 0; $hasSearch = ! empty($search); @endphp| @lang('Trader') | @lang('Tier') | @lang('KYC') | @lang('Ads') | @lang('Orders') | @lang('Completion') | @lang('Rating') | @lang('Action') |
|---|---|---|---|---|---|---|---|
|
@if(!empty($u->avatar))
|
{{ $tierLabel }} | @if($isSuspended) @lang('Suspended') @elseif($kycOk) @lang('Verified') @else @lang('Pending') @endif | {{ number_format((int) ($s['offers_count'] ?? 0)) }} | {{ number_format($totalOrders) }} | @lang('completion') {{ number_format($completion, 1) }}% | @if(($s['avg_rating'] ?? null) !== null) {{ number_format((float) $s['avg_rating'], 1) }} ({{ number_format((int) ($s['feedback_count'] ?? 0)) }}) @else — @endif |