This commit is contained in:
chenbo 2024-02-20 15:28:52 +08:00
parent 6e38198c21
commit b3fb33352d
1 changed files with 12 additions and 12 deletions

View File

@ -180,10 +180,10 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($rangeData)) { if (!empty($rangeData)) {
$ambientTemperatureDevice['RangeMonitorData'] = $rangeData[4]; $ambientTemperatureDevice['RangeMonitorData'] = $rangeData[4];
} else { } else {
$ambientTemperatureDevice['RangeMonitorData'] = []; $ambientTemperatureDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
} else { } else {
$ambientTemperatureDevice['RangeMonitorData'] = []; $ambientTemperatureDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
// 空气湿度 ambient_humidity // 空气湿度 ambient_humidity
@ -193,10 +193,10 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($rangeData)) { if (!empty($rangeData)) {
$ambientHumidityDevice['RangeMonitorData'] = $rangeData[4]; $ambientHumidityDevice['RangeMonitorData'] = $rangeData[4];
} else { } else {
$ambientHumidityDevice['RangeMonitorData'] = []; $ambientHumidityDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
} else { } else {
$ambientHumidityDevice['RangeMonitorData'] = []; $ambientHumidityDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
// 氮气 nitrogen // 氮气 nitrogen
$NDevice = Device::whereIn('id', $deviceIds)->where('monitor_item', 'nitrogen')->find(); $NDevice = Device::whereIn('id', $deviceIds)->where('monitor_item', 'nitrogen')->find();
@ -205,10 +205,10 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($rangeData)) { if (!empty($rangeData)) {
$NDevice['RangeMonitorData'] = $rangeData[4]; $NDevice['RangeMonitorData'] = $rangeData[4];
} else { } else {
$NDevice['RangeMonitorData'] = []; $NDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
} else { } else {
$NDevice['RangeMonitorData'] = []; $NDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
// 防火 fireproof // 防火 fireproof
$fireproofDevice = Device::whereIn('id', $deviceIds)->where('monitor_item', 'fireproof')->find(); $fireproofDevice = Device::whereIn('id', $deviceIds)->where('monitor_item', 'fireproof')->find();
@ -217,10 +217,10 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($rangeData)) { if (!empty($rangeData)) {
$fireproofDevice['RangeMonitorData'] = $rangeData[4]; $fireproofDevice['RangeMonitorData'] = $rangeData[4];
} else { } else {
$fireproofDevice['RangeMonitorData'] = []; $fireproofDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
} else { } else {
$fireproofDevice['RangeMonitorData'] = []; $fireproofDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
// 甲烷 methane // 甲烷 methane
@ -230,10 +230,10 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($rangeData)) { if (!empty($rangeData)) {
$methaneDevice['RangeMonitorData'] = $rangeData[4]; $methaneDevice['RangeMonitorData'] = $rangeData[4];
} else { } else {
$methaneDevice['RangeMonitorData'] = []; $methaneDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];;
} }
} else { } else {
$methaneDevice['RangeMonitorData'] = []; $methaneDevice['RangeMonitorData'] =[0,0,0,0,0,0,0];
} }
// 噪音 noise // 噪音 noise
@ -243,10 +243,10 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($rangeData)) { if (!empty($rangeData)) {
$noiseDevice['RangeMonitorData'] = $rangeData[4]; $noiseDevice['RangeMonitorData'] = $rangeData[4];
} else { } else {
$noiseDevice['RangeMonitorData'] = []; $noiseDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
} else { } else {
$noiseDevice['RangeMonitorData'] = []; $noiseDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
array_push($datas, $ambientTemperatureDevice, $ambientHumidityDevice, $fireproofDevice, $methaneDevice, $noiseDevice, $NDevice); array_push($datas, $ambientTemperatureDevice, $ambientHumidityDevice, $fireproofDevice, $methaneDevice, $noiseDevice, $NDevice);
return $datas; return $datas;