|
@@ -303,24 +303,24 @@ class StatsService
|
|
|
|
|
|
$data = array();
|
|
|
foreach($onus as $k => $device) {
|
|
|
- $extra = $device['extraData'];
|
|
|
+ $extra = json_decode($device['extra_data']);
|
|
|
|
|
|
- if(isset($extra['ponSerialNumberAux'])) {
|
|
|
- $sn = strtolower($extra['ponSerialNumberAux']);
|
|
|
+ if(isset($extra->ponSerialNumberAux)) {
|
|
|
+ $sn = strtolower($extra->ponSerialNumberAux);
|
|
|
$clientId = $lat = $lng = NULL;
|
|
|
|
|
|
- if(isset($extra['location']) && isset($extra['location']['extraData'])){
|
|
|
- if(isset($extra['location']['extraData']['lat'])){
|
|
|
- $lat = $extra['location']['extraData']['lat'];
|
|
|
+ if(isset($extra->location) && isset($extra->location->extraData)){
|
|
|
+ if(isset($extra->location->extraData->lat)){
|
|
|
+ $lat = $extra->location->extraData->lat;
|
|
|
}
|
|
|
|
|
|
- if(isset($extra['location']['extraData']['lng'])){
|
|
|
- $lng = $extra['location']['extraData']['lng'];
|
|
|
+ if(isset($extra->location->extraData->lng)){
|
|
|
+ $lng = $extra->location->extraData->lng;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(isset($extra['clientId'])){
|
|
|
- $clientId = $extra['clientId'];
|
|
|
+ if(isset($extra->clientId)){
|
|
|
+ $clientId = $extra->clientId;
|
|
|
}
|
|
|
|
|
|
$data[$sn] = array('deviceId' => $device['device_id'], 'lat' => $lat, 'lng' => $lng, 'clientId' => $clientId);
|