Skip to content

Commit

Permalink
Group by name only
Browse files Browse the repository at this point in the history
Fixes #63
Fixes #64
  • Loading branch information
cdubz committed Feb 2, 2024
1 parent 2a05ebc commit b955eb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Models/Traits/Ingredient.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public function ingredientAmountRelationships(): MorphMany {
public static function getTagTotals(string $locale = null): DatabaseCollection {
$locale = $locale ?? app()->getLocale();
return Tag::query()->join('taggables', 'taggables.tag_id', '=', 'id')
->select(['id', 'name', DB::raw('count(*) as total')])
->select(['name', DB::raw('count(*) as total')])
->where('taggables.taggable_type', '=', static::class)
->groupBy('id')
->groupBy('name')
->orderBy("name->{$locale}")
->get();
}
Expand Down

0 comments on commit b955eb5

Please sign in to comment.