Rtr A10 report now only includes system owners networks
This commit is contained in:
@@ -5,6 +5,11 @@ class Admin_RtrReporting {
|
||||
private $db;
|
||||
private $log;
|
||||
private $flash = [];
|
||||
private $systemowner_id = 1;
|
||||
|
||||
private $additional_owner_networks = [
|
||||
7 // mortantsch
|
||||
];
|
||||
|
||||
public function __construct($request = false) {
|
||||
$this->request = $request;
|
||||
@@ -41,6 +46,9 @@ class Admin_RtrReporting {
|
||||
|
||||
$rasterpunkte = [];
|
||||
foreach(BuildingModel::getAll() as $building) {
|
||||
// limit to sytemowners networks
|
||||
if($building->network->owner_id != $this->systemowner_id && !in_array($building->network->owner_id, $this->additional_owner_networks)) continue;
|
||||
|
||||
$raster = $building->laea;
|
||||
if(!$raster) continue;
|
||||
|
||||
@@ -62,7 +70,7 @@ class Admin_RtrReporting {
|
||||
"user_count" => 0
|
||||
];
|
||||
}
|
||||
$rasterpunkte[$raster][$prod_code]["user_count"] += $user_count;
|
||||
$rasterpunkte[$raster][$prod_code]["user_count"] = $user_count;
|
||||
}
|
||||
|
||||
$building = new Building();
|
||||
@@ -72,7 +80,7 @@ class Admin_RtrReporting {
|
||||
|
||||
$address = $contract->owner;
|
||||
if(!$address->gps_lat || !$address->gps_long || !$address->laea) {
|
||||
$address->save(); // gets gps and laea
|
||||
$address->save(); // gets gps and laea after saving
|
||||
}
|
||||
|
||||
$raster = $address->laea;
|
||||
@@ -105,7 +113,7 @@ class Admin_RtrReporting {
|
||||
continue;
|
||||
}
|
||||
|
||||
$rasterpunkte[$raster][$prod_code]["user_count"] += $rtr100m->unit_count;
|
||||
$rasterpunkte[$raster][$prod_code]["user_count"] = $rtr100m->unit_count;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user