Compare commits

..

No commits in common. "b4f2e658adea5f5ddc41946b34b3f15d68035889" and "a9430680731574f86e8c54a7b14d7155e8daff2c" have entirely different histories.

View file

@ -25,7 +25,7 @@ class PopularCategoryChart extends ChartWidget
protected function getData(): array
{
$categories = Category::where('type', 'game')->get()->sortBy('id')->sortDesc();
$categories = Category::where('type', 'game')->get();
$categoryNames = [];
foreach ($categories as $obj){
@ -34,15 +34,17 @@ class PopularCategoryChart extends ChartWidget
$items = Reserveditem::withTrashed()->with('item')->whereHas('item', function($query){
return $query->where('type', 'game');
})->get()->groupBy('item.category_id')->sortBy('item.category_id')->sortDesc();
})->get()->groupBy('item.category_id');
$itemCategoriesCount = [];
foreach ($items as $item){
$itemCategoriesCount[] = $item->count();
$itemCategoriesCount[] = $item->count();
}
return [
'datasets' => [
[