refs #44 fix photo retrieval sql queries

This commit is contained in:
Julien Veyssier 2019-04-20 13:44:12 +02:00
Родитель d2fad23b37
Коммит 8406a942c3
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -40,12 +40,12 @@ class GeophotoMapper extends Mapper {
}
public function findAll($userId, $limit=null, $offset=null) {
$sql = 'SELECT * FROM `*PREFIX*maps_photos` where `user_id` = ? and `lat` is not null and `long` is not null';
$sql = 'SELECT * FROM `*PREFIX*maps_photos` where `user_id` = ? and `lat` is not null and `lng` is not null';
return $this->findEntities($sql, [$userId], $limit, $offset);
}
public function findAllNonLocalized($userId, $limit=null, $offset=null) {
$sql = 'SELECT * FROM `*PREFIX*maps_photos` where `user_id` = ? and (`lat` is null or `long` is null)';
$sql = 'SELECT * FROM `*PREFIX*maps_photos` where `user_id` = ? and (`lat` is null or `lng` is null)';
return $this->findEntities($sql, [$userId], $limit, $offset);
}