⚙️ Raise top‑meetup and top‑country limits from 10 → 15; add guard for empty sparkline data before rendering chart.

This commit is contained in:
HolgerHatGarKeineNode
2025-12-09 21:32:13 +01:00
parent e18d79aa40
commit 9511bcdb11
2 changed files with 9 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ class extends Component {
->groupBy('countries.id') ->groupBy('countries.id')
->selectRaw('COUNT(DISTINCT meetup_user.user_id) as user_count') ->selectRaw('COUNT(DISTINCT meetup_user.user_id) as user_count')
->orderBy('user_count', 'desc') ->orderBy('user_count', 'desc')
->limit(10) ->limit(15)
->get() ->get()
->map(function ($country) { ->map(function ($country) {
// Optimierte Query: Hole alle User-Erstellungsdaten für dieses Land auf einmal // Optimierte Query: Hole alle User-Erstellungsdaten für dieses Land auf einmal
@@ -104,11 +104,13 @@ class extends Component {
</div> </div>
</div> </div>
</a> </a>
@if(count($country->sparkline) > 1)
<flux:chart :value="$country->sparkline" class="w-[5rem] aspect-[3/1]"> <flux:chart :value="$country->sparkline" class="w-[5rem] aspect-[3/1]">
<flux:chart.svg gutter="0"> <flux:chart.svg gutter="0">
<flux:chart.line class="text-green-500 dark:text-green-400"/> <flux:chart.line class="text-green-500 dark:text-green-400"/>
</flux:chart.svg> </flux:chart.svg>
</flux:chart> </flux:chart>
@endif
</div> </div>
@endforeach @endforeach
</div> </div>

View File

@@ -13,7 +13,7 @@ class extends Component {
$topMeetups = Meetup::withCount('users') $topMeetups = Meetup::withCount('users')
->with(['city.country']) ->with(['city.country'])
->orderBy('users_count', 'desc') ->orderBy('users_count', 'desc')
->limit(10) ->limit(15)
->get() ->get()
->map(function ($meetup) { ->map(function ($meetup) {
// Optimierte Query: Hole alle User-Erstellungsdaten für dieses Meetup auf einmal // Optimierte Query: Hole alle User-Erstellungsdaten für dieses Meetup auf einmal