added new fcp filter
This commit is contained in:
@@ -196,7 +196,8 @@ class AddressDBController extends mfBaseController {
|
||||
|
||||
if(is_array($filter) && count($filter)) {
|
||||
foreach($filter as $name => $value) {
|
||||
if(strlen($value) > 0) $new_filter[$name] = $value;
|
||||
if (is_array($value) && count($value)) $new_filter[$name] = $value;
|
||||
else if(strlen($value) > 0) $new_filter[$name] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -821,6 +822,9 @@ class AddressDBController extends mfBaseController {
|
||||
case 'getUnit':
|
||||
$return = $this->getUnitApi();
|
||||
break;
|
||||
case 'getFCPsForNetwork':
|
||||
$return = $this->getFCPsForNetworkApi();
|
||||
break;
|
||||
case "findUnit":
|
||||
break;
|
||||
default:
|
||||
@@ -1364,4 +1368,14 @@ class AddressDBController extends mfBaseController {
|
||||
return ["count" => count($buildings), "buildings" => $results];
|
||||
|
||||
}
|
||||
|
||||
protected function getFCPsForNetworkApi(): array {
|
||||
if (!$this->request->network_id) return [];
|
||||
|
||||
return array_map(
|
||||
fn($fcp) => ["id" => $fcp->name ?? null, "text" => $fcp->name ?? null, 'lat' => $fcp->gps_lat ?? null, 'lng' => $fcp->gps_long ?? null],
|
||||
ADBRimoFcp::getAll(["netzgebiet_id" => intval($this->request->network_id)]) ?? []
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user