Ignore markers without defined coordinates.

This commit is contained in:
David Molineus
2018-12-06 10:37:39 +01:00
parent 0e2b8dd3cd
commit 57ba63556a
2 changed files with 15 additions and 1 deletions

View File

@@ -44,7 +44,18 @@ class MarkerModel extends AbstractActiveModel
public static function findByFilter($pid, ?Filter $filter = null)
{
if (!$filter) {
return static::findActiveBy('pid', $pid, ['order' => 'sorting']);
$table = static::getTable();
return static::findBy(
[
$table . '.active=1',
$table . '.pid=?',
$table . '.latitude>0',
$table . '.longitude>0',
],
[$pid],
['order' => 'sorting']
);
}
switch (true) {