From fc4d38dfc316296eb3d037ff42142496a505ba49 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Mon, 17 Feb 2025 12:22:29 +0000 Subject: [PATCH] Update ConstructionConsentController.php --- .../ConstructionConsentController.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/application/ConstructionConsent/ConstructionConsentController.php b/application/ConstructionConsent/ConstructionConsentController.php index 1745f807d..a87557089 100644 --- a/application/ConstructionConsent/ConstructionConsentController.php +++ b/application/ConstructionConsent/ConstructionConsentController.php @@ -938,16 +938,16 @@ class ConstructionConsentController extends mfBaseController { return ["message" => "ConstructionConsent saved successfully"]; } - private function generateStats($baseFilter = []): array { - $allCount = ConstructionConsent::count([...$baseFilter]); - $streetCount = ConstructionConsent::count(["object_type" => "street", ...$baseFilter]); - $buildingCount = ConstructionConsent::count(["object_type" => "building", ...$baseFilter]); - $inspection_planner = ConstructionConsent::count(["inspection_planner" => "!NULL", ...$baseFilter]); - $conduit_installed_building = ConstructionConsent::count(["conduit_installed_building" => "!NULL", ...$baseFilter]); - $conduit_installed_ftu = ConstructionConsent::count(["conduit_installed_ftu" => "!NULL", ...$baseFilter]); - $inhouse_cabling = ConstructionConsent::count(["inhouse_cabling" => "!NULL", ...$baseFilter]); + private function generateStats($baseFilter = array()) { + $allCount = ConstructionConsent::count(array_merge(array(), $baseFilter)); + $streetCount = ConstructionConsent::count(array_merge(array("object_type" => "street"), $baseFilter)); + $buildingCount = ConstructionConsent::count(array_merge(array("object_type" => "building"), $baseFilter)); + $inspection_planner = ConstructionConsent::count(array_merge(array("inspection_planner" => "!NULL"), $baseFilter)); + $conduit_installed_building = ConstructionConsent::count(array_merge(array("conduit_installed_building" => "!NULL"), $baseFilter)); + $conduit_installed_ftu = ConstructionConsent::count(array_merge(array("conduit_installed_ftu" => "!NULL"), $baseFilter)); + $inhouse_cabling = ConstructionConsent::count(array_merge(array("inhouse_cabling" => "!NULL"), $baseFilter)); - return [ + return array( "all" => $allCount, "street" => $streetCount, "building" => $buildingCount, @@ -955,6 +955,6 @@ class ConstructionConsentController extends mfBaseController { "conduit_installed_building" => $conduit_installed_building, "conduit_installed_ftu" => $conduit_installed_ftu, "inhouse_cabling" => $inhouse_cabling - ]; + ); } -} \ No newline at end of file +}