Skip to content

Commit

Permalink
add group by on username for pgsql ?
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Oct 10, 2024
1 parent f25a8be commit 5668c6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Actions/Statistics/Spaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function getPhotoCountPerAlbum(?string $album_id = null, ?int $owner_id =
'albums._lft',
'albums._rgt',
DB::raw('COUNT(photos.id) as num_photos'),
)->groupBy('albums.id')
)->groupBy('albums.id', 'username')
->orderBy('albums._lft', 'asc');

return $query
Expand Down Expand Up @@ -201,7 +201,7 @@ public function getTotalPhotoCountPerAlbum(?string $album_id = null, ?int $owner
'albums._lft',
'albums._rgt',
DB::raw('COUNT(photos.id) as num_photos'),
)->groupBy('albums.id')
)->groupBy('albums.id', 'username')
->orderBy('albums._lft', 'asc');

return $query
Expand Down

0 comments on commit 5668c6f

Please sign in to comment.