Ignore markers without defined coordinates.

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

No files matched your search

+12 -1
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) {