get my_networks from parent address if exists

This commit is contained in:
Frank Schubert
2021-08-05 20:45:16 +02:00
parent c06bb156c7
commit c300830a06
4 changed files with 51 additions and 31 deletions

View File

@@ -93,7 +93,7 @@ class BuildingModel {
$res = $db->query($sql);
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
$items[] = new Address($data);
$items[] = new Building($data);
}
}
return $items;
@@ -102,9 +102,14 @@ class BuildingModel {
private function getSqlFilter($filter) {
$where = "1=1 ";
/*
* Address Type
*/
if(array_key_exists("network_id", $filter)) {
$network_id = $filter['network_id'];
if(is_numeric($network_id)) {
$where .= " AND Building.network_id=$network_id";
}
}
if(is_array($filter['type']) && count($filter['type'])) {
$ot = $filter['type'];
$in = [];