diff --git a/src/Controller/MapsController.php b/src/Controller/MapsController.php index d56dd59..95b37a0 100644 --- a/src/Controller/MapsController.php +++ b/src/Controller/MapsController.php @@ -32,6 +32,7 @@ class MapsController new RawExpression('COUNT(places.id) AS num_places') ]); $select->leftJoin('places', ['places', 'map_id'], '=', ['maps', 'id']); + $select->groupBy(['maps', 'id']); $select->orderBy('name'); $result = $select->execute();