@php $rawMatches = collect($playedMatches ?? []); // ডুপ্লিকেট রিমুভ করার জন্য শক্ত লজিক $allMatches = $rawMatches->groupBy(function ($item) { return $item->Match_Key ?? $item->match_key ?? $item->id; })->map(function ($group) { // উইনিং অ্যামাউন্টের ভিত্তিতে সাজিয়ে সবচেয়ে বড়টা নিচ্ছে return $group->sortByDesc(function($match) { return floatval($match->winnings ?? 0); })->first(); })->values(); // ফিল্টারিং $participatedMatches = $allMatches->filter(function($match) { return floatval($match->winnings ?? 0) <= 0; }); $winningMatches = $allMatches->filter(function($match) { return floatval($match->winnings ?? 0) > 0; }); @endphp
Orbit Esports
{{ number_format(auth()->user()->Balance ?? 0) }} Tk
All
Participated
Winning
@forelse ($allMatches as $index => $match)
{{ sprintf('%02d', $index + 1) }}
{{ $match->Match_Title ?? '' }}
{{ $match->Entry_Type ?? '' }}
{{ isset($match->Match_Time) ? \Carbon\Carbon::parse($match->Match_Time)->format('d M, h:i A') : '' }}
@if(floatval($match->winnings ?? 0) > 0)
Won: {{ floatval($match->winnings) }} TK
@else
Played
@endif
Fee: {{ intval($match->Entry_Fee ?? 0) }} TK
@empty
No matches found
@endforelse
@forelse ($participatedMatches as $index => $match)
{{ sprintf('%02d', $index + 1) }}
{{ $match->Match_Title ?? '' }}
{{ $match->Entry_Type ?? '' }}
{{ isset($match->Match_Time) ? \Carbon\Carbon::parse($match->Match_Time)->format('d M, h:i A') : '' }}
@if(floatval($match->winnings ?? 0) > 0)
Won: {{ floatval($match->winnings) }} TK
@else
Played
@endif
Fee: {{ intval($match->Entry_Fee ?? 0) }} TK
@empty
No matches found
@endforelse
@forelse ($winningMatches as $index => $match)
{{ sprintf('%02d', $index + 1) }}
{{ $match->Match_Title ?? '' }}
{{ $match->Entry_Type ?? '' }}
{{ isset($match->Match_Time) ? \Carbon\Carbon::parse($match->Match_Time)->format('d M, h:i A') : '' }}
@if(floatval($match->winnings ?? 0) > 0)
Won: {{ floatval($match->winnings) }} TK
@else
Played
@endif
Fee: {{ intval($match->Entry_Fee ?? 0) }} TK
@empty
No matches found
@endforelse
@include('partials.bottom-nav')