added new fcp filter

This commit is contained in:
2025-09-11 14:32:39 +02:00
parent 8a53e31fa3
commit e1bfb5e96d
3 changed files with 115 additions and 26 deletions

View File

@@ -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)]) ?? []
);
}
}