@extends('admin.layout') @section('title', 'Tiếp thị liên kết') @section('greeting') TIẾP THỊ LIÊN KẾT @endsection @section('subtitle') Quản lý hệ thống affiliate & hoa hồng @endsection @section('content') {{-- Stats Cards --}}
Tổng giới thiệu
{{ $totalReferrals }}
Affiliates hoạt động
{{ $activeAffiliates }}
Tổng số dư Affiliate
{{ number_format($totalBalance) }}đ
{{-- Commission Setting --}}

Cài đặt hoa hồng

@csrf
%
Áp dụng cho tất cả đơn hàng thành công từ người được giới thiệu
{{-- Withdrawal Requests --}}

Yêu cầu rút tiền @if($withdrawals->where('status', 'pending')->count() > 0) {{ $withdrawals->where('status', 'pending')->count() }} chờ duyệt @endif

@forelse($withdrawals as $wd) @empty @endforelse
Thời gian Username Số tiền Ngân hàng STK Chủ TK Trạng thái Hành động
{{ $wd->created_at ? \Carbon\Carbon::parse($wd->created_at)->format('d/m/Y H:i') : '—' }} {{ $wd->username }} {{ number_format($wd->amount) }}đ {{ $wd->bank_name }} {{ $wd->bank_account }} {{ $wd->bank_owner }} @if($wd->status === 'pending') ⏳ Chờ duyệt @elseif($wd->status === 'approved') ✅ Đã duyệt @else ❌ Từ chối @endif @if($wd->status === 'pending')
@csrf @method('PUT')
@csrf @method('PUT')
@else {{ $wd->processed_at ? \Carbon\Carbon::parse($wd->processed_at)->format('d/m H:i') : '' }} @endif
Chưa có yêu cầu rút tiền nào.
{{-- Filters --}}
{{-- User Referral Rankings --}}

Bảng xếp hạng Affiliate

@forelse($users as $i => $user) @empty @endforelse
# Username Email Mã giới thiệu Số người GT Hoa hồng riêng Số dư hiện tại Tổng HH
@if($users->firstItem() + $i <= 3) @php $medals = ['🥇','🥈','🥉']; @endphp {{ $medals[$users->firstItem() + $i - 1] ?? '' }} @else {{ $users->firstItem() + $i }} @endif {{ $user->username }} {{ $user->email }} {{ $user->referral_code }} @if($user->ref_count > 0) {{ $user->ref_count }} người @else 0 @endif
@csrf @method('PUT') % @if($user->custom_commission !== null) @endif
@csrf @method('PUT') đ
@if($user->total_earned > 0) {{ number_format($user->total_earned) }}đ @else 0đ @endif
Chưa có affiliate nào.
{{ $users->links('admin.pagination') }}
{{-- Recent Referral Logs --}}

Lịch sử giới thiệu gần đây

@forelse($logs as $log) @empty @endforelse
Thời gian Người giới thiệu Người được GT Trạng thái Hoa hồng
{{ $log->created_at ? \Carbon\Carbon::parse($log->created_at)->format('d/m/Y H:i') : '—' }} {{ $log->referrer_name }} {{ $log->referred_name }} @if($log->status === 'paid') Đã thanh toán @elseif($log->status === 'registered') Đã đăng ký @else {{ $log->status }} @endif @if($log->commission > 0) +{{ number_format($log->commission) }}đ @else — @endif
Chưa có lịch sử giới thiệu.
@endsection