From b3fb33352dd8eac21855eb94995a00da0219a133 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Tue, 20 Feb 2024 15:28:52 +0800 Subject: [PATCH] update --- app/common/logic/RemoteRequestLogic.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/common/logic/RemoteRequestLogic.php b/app/common/logic/RemoteRequestLogic.php index 4801317..76a7aa9 100644 --- a/app/common/logic/RemoteRequestLogic.php +++ b/app/common/logic/RemoteRequestLogic.php @@ -180,10 +180,10 @@ class RemoteRequestLogic extends BaseLogic if (!empty($rangeData)) { $ambientTemperatureDevice['RangeMonitorData'] = $rangeData[4]; } else { - $ambientTemperatureDevice['RangeMonitorData'] = []; + $ambientTemperatureDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } } else { - $ambientTemperatureDevice['RangeMonitorData'] = []; + $ambientTemperatureDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } // 空气湿度 ambient_humidity @@ -193,10 +193,10 @@ class RemoteRequestLogic extends BaseLogic if (!empty($rangeData)) { $ambientHumidityDevice['RangeMonitorData'] = $rangeData[4]; } else { - $ambientHumidityDevice['RangeMonitorData'] = []; + $ambientHumidityDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } } else { - $ambientHumidityDevice['RangeMonitorData'] = []; + $ambientHumidityDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } // 氮气 nitrogen $NDevice = Device::whereIn('id', $deviceIds)->where('monitor_item', 'nitrogen')->find(); @@ -205,10 +205,10 @@ class RemoteRequestLogic extends BaseLogic if (!empty($rangeData)) { $NDevice['RangeMonitorData'] = $rangeData[4]; } else { - $NDevice['RangeMonitorData'] = []; + $NDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } } else { - $NDevice['RangeMonitorData'] = []; + $NDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } // 防火 fireproof $fireproofDevice = Device::whereIn('id', $deviceIds)->where('monitor_item', 'fireproof')->find(); @@ -217,10 +217,10 @@ class RemoteRequestLogic extends BaseLogic if (!empty($rangeData)) { $fireproofDevice['RangeMonitorData'] = $rangeData[4]; } else { - $fireproofDevice['RangeMonitorData'] = []; + $fireproofDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } } else { - $fireproofDevice['RangeMonitorData'] = []; + $fireproofDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } // 甲烷 methane @@ -230,10 +230,10 @@ class RemoteRequestLogic extends BaseLogic if (!empty($rangeData)) { $methaneDevice['RangeMonitorData'] = $rangeData[4]; } else { - $methaneDevice['RangeMonitorData'] = []; + $methaneDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];; } } else { - $methaneDevice['RangeMonitorData'] = []; + $methaneDevice['RangeMonitorData'] =[0,0,0,0,0,0,0]; } // 噪音 noise @@ -243,10 +243,10 @@ class RemoteRequestLogic extends BaseLogic if (!empty($rangeData)) { $noiseDevice['RangeMonitorData'] = $rangeData[4]; } else { - $noiseDevice['RangeMonitorData'] = []; + $noiseDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } } else { - $noiseDevice['RangeMonitorData'] = []; + $noiseDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; } array_push($datas, $ambientTemperatureDevice, $ambientHumidityDevice, $fireproofDevice, $methaneDevice, $noiseDevice, $NDevice); return $datas;