{{$user->rank->name}}
Tổng chi tiêu hiện tại
{{number_format($user->point)}}đ
Còn {{number_format($nextRank->total - $user->point)}}đ
0₫
{{number_format($nextRank->total)}}đ
@else
{{number_format($currentRank->total)}}đ
∞
@endif
@if($nextRank)
@else
@endif
@isset($categoryProduct)
🎯 Chỉ cần thêm {{number_format($nextRank->total - $user->point)}}đ nữa!
Mua sắm ngay để lên hạng {{$nextRank->name}} và nhận ưu đãi tốt hơn
@endisset
🏆 Quyền lợi {{$nextRank->name}}
{!!$nextRank->description!!}
🏅 Bạn đã đạt hạng cao nhất!
Tận hưởng toàn bộ ưu đãi đặc biệt dành cho bạn.
🏆 Quyền lợi hiện tại
{!!$currentRank->description!!}
@php
$currentRankIndex = null;
foreach ($ranks as $index => $item) {
if ($user->rank_id == $item->id) {
$currentRankIndex = $index;
break;
}
}
@endphp
@foreach($ranks as $index => $item)
@php
if ($index === $currentRankIndex) {
$class = 'current';
} elseif ($index < $currentRankIndex) {
$class='completed' ;
} else {
$class='upcoming' ;
}
// Gán thêm logic: nếu point user>= 90% của rank kế tiếp thì vẫn xem như "current"
if ($index === $currentRankIndex + 1 && $user->point >= ($item->total * 0.9)) {
$class = 'current';
}
@endphp
@endforeach
{{ $item->name }}
{{ number_format($item->total) }}đ