replaced left join with inner join for older places search
All checks were successful
default-pipeline default-pipeline #169

This commit is contained in:
Balázs Vigh 2021-05-05 21:58:19 +02:00
parent 3c6a7a3c5f
commit 8136273b33

View File

@ -142,9 +142,8 @@ class PlaceRepository
// count places that were visited at least once // count places that were visited at least once
$selectOldPlaces = new Select(\Container::$dbConnection, 'places'); $selectOldPlaces = new Select(\Container::$dbConnection, 'places');
$selectOldPlaces->leftJoin($selectPlacesByCurrentUser, ['places', 'id'], '=', ['places_by_current_user', 'place_id']); $selectOldPlaces->innerJoin($selectPlacesByCurrentUser, ['places', 'id'], '=', ['places_by_current_user', 'place_id']);
$selectOldPlaces->where('map_id', '=', $mapId); $selectOldPlaces->where('map_id', '=', $mapId);
$selectOldPlaces->where('last_time', 'IS NOT', null);
$numberOfOldPlaces = $selectOldPlaces->count(); $numberOfOldPlaces = $selectOldPlaces->count();
// set order by datetime, oldest first // set order by datetime, oldest first