|
@@ -64,7 +64,9 @@ class StatsOnuCommand extends BaseCommand
|
|
|
|
|
|
foreach($onus as $index => $onu) {
|
|
foreach($onus as $index => $onu) {
|
|
$sn = $onu['serialNumber'];
|
|
$sn = $onu['serialNumber'];
|
|
- $lowSn = strtolower($sn);
|
|
|
|
|
|
+ $lowSn = strtolower($sn);
|
|
|
|
+ $serialNumber = $this->snCalulate($sn);
|
|
|
|
+ $ponSerialNumber = $this->psnCalulate($sn);
|
|
$row = array();
|
|
$row = array();
|
|
$row['deviceServer'] = $deviceServerId;
|
|
$row['deviceServer'] = $deviceServerId;
|
|
$ponPort = $onu['ponport'];
|
|
$ponPort = $onu['ponport'];
|
|
@@ -80,9 +82,11 @@ class StatsOnuCommand extends BaseCommand
|
|
$row['oltDeviceId'] = $oltDeviceId;
|
|
$row['oltDeviceId'] = $oltDeviceId;
|
|
$row['tenancyId'] = $tenancyId;
|
|
$row['tenancyId'] = $tenancyId;
|
|
$row['ip'] = "NULL";
|
|
$row['ip'] = "NULL";
|
|
- $row['mac'] = "NULL";
|
|
|
|
- $row['serialNumber'] = "'".$this->snCalulate($sn)."'";
|
|
|
|
- $row['ponSerialNumber'] = "'".$this->psnCalulate($sn)."'";
|
|
|
|
|
|
+ $row['mac'] = "NULL";
|
|
|
|
+ $row['serialNumber'] = "'{$serialNumber}'";
|
|
|
|
+ $row['ponSerialNumber'] = "'{$ponSerialNumber}'";
|
|
|
|
+ //$row['serialNumber'] = "'".$this->snCalulate($sn)."'";
|
|
|
|
+ //$row['ponSerialNumber'] = "'".$this->psnCalulate($sn)."'";
|
|
$row['ponPort'] = "'".$ponPort."'";
|
|
$row['ponPort'] = "'".$ponPort."'";
|
|
|
|
|
|
foreach($metrics as $m => $metric) {
|
|
foreach($metrics as $m => $metric) {
|
|
@@ -116,6 +120,7 @@ class StatsOnuCommand extends BaseCommand
|
|
$row['clientName'] = "NULL";
|
|
$row['clientName'] = "NULL";
|
|
$row['clientAddress'] = "NULL";
|
|
$row['clientAddress'] = "NULL";
|
|
|
|
|
|
|
|
+ /*
|
|
if(isset($devices[$lowSn]) && isset($devices[$lowSn]['clientId'])) {
|
|
if(isset($devices[$lowSn]) && isset($devices[$lowSn]['clientId'])) {
|
|
$clientId = $devices[$lowSn]['clientId'];
|
|
$clientId = $devices[$lowSn]['clientId'];
|
|
if(isset($clients[$clientId])) {
|
|
if(isset($clients[$clientId])) {
|
|
@@ -124,7 +129,25 @@ class StatsOnuCommand extends BaseCommand
|
|
$row['clientName'] = "'".$clients[$clientId]['name']."'";
|
|
$row['clientName'] = "'".$clients[$clientId]['name']."'";
|
|
$row['clientAddress'] = "'".$clients[$clientId]['address']."'";
|
|
$row['clientAddress'] = "'".$clients[$clientId]['address']."'";
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
+ if(isset($devices[$serialNumber]) && isset($devices[$serialNumber]['clientId'])) {
|
|
|
|
+ $clientId = $devices[$serialNumber]['clientId'];
|
|
|
|
+ if(isset($clients[$clientId])) {
|
|
|
|
+ $row['clientId'] = $clientId;
|
|
|
|
+ $row['clientExternalId'] = "'".$clients[$clientId]['externalId']."'";
|
|
|
|
+ $row['clientName'] = "'".$clients[$clientId]['name']."'";
|
|
|
|
+ $row['clientAddress'] = "'".$clients[$clientId]['address']."'";
|
|
|
|
+ }
|
|
|
|
+ } elseif(isset($devices[$ponSerialNumber]) && isset($devices[$ponSerialNumber]['clientId'])) {
|
|
|
|
+ $clientId = $devices[$ponSerialNumber]['clientId'];
|
|
|
|
+ if(isset($clients[$clientId])) {
|
|
|
|
+ $row['clientId'] = $clientId;
|
|
|
|
+ $row['clientExternalId'] = "'".$clients[$clientId]['externalId']."'";
|
|
|
|
+ $row['clientName'] = "'".$clients[$clientId]['name']."'";
|
|
|
|
+ $row['clientAddress'] = "'".$clients[$clientId]['address']."'";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
$data[] = "(".implode(",",$row).")".PHP_EOL;
|
|
$data[] = "(".implode(",",$row).")".PHP_EOL;
|
|
}
|
|
}
|