@extends('layouts.admin') @section('title', 'Chi tiết Giftcode') @section('styles') @endsection @section('content')

Thông tin cơ bản

ID
#{{ $giftcode->id }}
Trạng thái
@if($giftcode->is_active) Hoạt động @else Vô hiệu hóa @endif
Tên
{{ $giftcode->name ?: $giftcode->content }}
Mã Code
@if(count($codes) > 1)
{{ $codes[0] }} +{{ count($codes) - 1 }} khác
@else
{{ $codes[0] ?? 'N/A' }}
@endif
Nội dung
{{ $giftcode->content }}
Loại
@switch($giftcode->type) @case(1) Công khai @break @case(2) Riêng tư @break @case(0) Theo nhân vật @break @default Khác @endswitch
Server
{{ $giftcode->zoneid == 0 ? 'Tất cả server' : 'Server ' . $giftcode->zoneid }}
Giới hạn sử dụng
{{ $giftcode->limit > 0 ? number_format($giftcode->limit) : 'Không giới hạn' }}
Đã sử dụng
{{ number_format($giftcode->getUsageCount()) }}
Ngày tạo
{{ \Carbon\Carbon::parse($giftcode->created_at)->format('d/m/Y H:i:s') }}
Hết hạn
@if($giftcode->period > 0) {{ \Carbon\Carbon::parse($giftcode->created_at)->addDays($giftcode->period)->format('d/m/Y H:i:s') }} @else Không giới hạn @endif
@if($giftcode->accounts && $giftcode->type == 2)
Tài khoản được phép
@foreach(explode(',', $giftcode->accounts) as $account) @endforeach
@endif

Vật phẩm thưởng

{{ count($giftcode->getItemsArray()) }} vật phẩm
@if($giftcode->items && count($giftcode->getItemsArray()) > 0)
@foreach($giftcode->getItemsArray() as $index => $item) @php $parts = explode(',', trim($item)); if (count($parts) >= 7) { $itemId = $parts[0]; $count = $parts[1]; $binding = $parts[2]; $forgeLevel = $parts[3]; $appendPropLev = $parts[4]; $lucky = $parts[5]; $excellenceInfo = $parts[6]; } @endphp @if(count($parts) >= 7)
Item #{{ $itemId }} x{{ $count }}
Binding: {{ $binding == 1 ? 'Yes' : 'No' }}
Forge: +{{ $forgeLevel }}
Append: {{ $appendPropLev }}
Lucky: {{ $lucky == 1 ? 'Yes' : 'No' }}
Excellence: {{ $excellenceInfo }}
@endif @endforeach
@else

Không có vật phẩm nào

@endif
@if(count($codes) > 1)

🔢 Tất cả mã Code ({{ count($codes) }})

@foreach($codes as $index => $code)
{{ $code }}
@endforeach
@endif

Thống kê

@php $usageCount = $giftcode->getUsageCount(); $usagePercent = $giftcode->limit > 0 ? ($usageCount / $giftcode->limit) * 100 : 0; $remainingUses = $giftcode->limit > 0 ? max(0, $giftcode->limit - $usageCount) : 'Không giới hạn'; $isExpired = $giftcode->period > 0 && \Carbon\Carbon::parse($giftcode->created_at)->addDays($giftcode->period)->isPast(); $isUsedUp = $giftcode->limit > 0 && $usageCount >= $giftcode->limit; @endphp
Tỷ lệ sử dụng
{{ number_format($usagePercent, 1) }}%
Còn lại
{{ is_numeric($remainingUses) ? number_format($remainingUses) : $remainingUses }}
Trạng thái hiện tại
@if(!$giftcode->is_active) Vô hiệu hóa @elseif($isExpired) Hết hạn @elseif($isUsedUp) Hết lượt @else Hoạt động @endif

Thao tác nhanh

Chỉnh sửa
@if($usageHistory && $usageHistory->count() > 0)

📈 Lịch sử sử dụng ({{ $usageHistory->count() }} gần nhất)

@foreach($usageHistory as $usage) @endforeach
Thời gian Tài khoản Nhân vật Server
{{ \Carbon\Carbon::parse($usage->created_at)->format('d/m/Y H:i:s') }} {{ $usage->uid }} {{ $usage->rid ?: 'N/A' }} {{ $usage->zoneid ?: 'N/A' }}
@endif
@endsection