@extends('layouts.app') @section('title', 'Tiếp thị liên kết - Locket Gold') @section('content') @include('partials.header')
@include('partials.topbar')
{{-- Header --}}
🤝

Tiếp thị liên kết

Giới thiệu bạn bè, nhận hoa hồng {{ $commissionRate }}% mỗi đơn hàng

{{-- Referral Link Card --}}

🔗 Link giới thiệu của bạn

Mã giới thiệu: {{ $user->referral_code }}

{{-- Stats Cards (Horizontal Strip) --}}
{{ $totalReferrals }}
Đã giới thiệu
{{ $buyers }}
Người mua gói
{{ number_format($totalEarnings) }}đ
Tổng hoa hồng
{{ number_format($balance) }}đ
Số dư
{{-- How it works --}}

📖 Cách hoạt động

1
Chia sẻ link giới thiệu
Gửi link cho bạn bè qua mạng xã hội, tin nhắn...
2
Bạn bè đăng ký & mua gói
Họ tạo tài khoản qua link và nâng cấp gói bất kỳ
3
Nhận hoa hồng {{ $commissionRate }}%
Bạn được {{ $commissionRate }}% giá trị đơn hàng cho mỗi giao dịch thành công
{{-- Referral List (Collapsible) --}}
{{-- Withdraw Section --}}

💰 Rút tiền hoa hồng

@if(session('success'))
✅ {{ session('success') }}
@endif @if(session('error'))
❌ {{ session('error') }}
@endif {{-- Balance --}}
Số dư khả dụng
{{ number_format($balance) }}đ
@if($balance < 50000)
Tiến trình rút tiền {{ number_format($balance) }} / 50.000đ

Cần thêm {{ number_format(50000 - $balance) }}đ để đủ điều kiện rút

@endif
@if($balance >= 50000 && !$hasPending)
@csrf

Tối thiểu 50.000đ • Admin sẽ duyệt trong 24h

@elseif($hasPending)
⏳
Đang chờ admin duyệt yêu cầu rút tiền
Vui lòng chờ admin xử lý trước khi gửi yêu cầu mới
@elseif($balance < 50000)
Giới thiệu thêm bạn bè để đạt mức rút tối thiểu 50.000đ
@endif
{{-- Withdrawal History --}} @if($withdrawals->count() > 0)

📋 Lịch sử rút tiền

@foreach($withdrawals as $wd)
{{ number_format($wd->amount) }}đ
{{ $wd->bank_name }} • {{ $wd->bank_account }}
{{ $wd->created_at ? \Carbon\Carbon::parse($wd->created_at)->format('d/m/Y H:i') : '' }}
@if($wd->status === 'approved') ✅ Đã duyệt @elseif($wd->status === 'rejected') ❌ Từ chối @else ⏳ Chờ duyệt @endif
@endforeach
@endif
@endsection