Fixed widgets on admin view

This commit is contained in:
Anna-Sara Sélea 2025-11-01 18:06:00 +01:00
parent 7062c98853
commit b292b488ac

View file

@ -32,11 +32,7 @@ class PopularCategoryChart extends ChartWidget
// $categoryNames[] = $obj->name; // $categoryNames[] = $obj->name;
//} //}
$items = Reserveditem::withTrashed()->with('item')->whereHas('item', function($query){ $items = Reserveditem::withTrashed()->with('item')->get()->groupBy('item.category_id');
return $query->where('type', 'game');
})->get()->groupBy('item.category_id')->sortBy('item.category_id');
$itemCategoriesCount = []; $itemCategoriesCount = [];
foreach ($items as $item){ foreach ($items as $item){