This commit is contained in:
chenbo 2024-02-21 16:18:41 +08:00
parent a65aecd7cf
commit 4c44312dc2
2 changed files with 11 additions and 7 deletions

View File

@ -19,7 +19,7 @@ use think\exception\ValidateException;
class DeviceController extends BaseApiController class DeviceController extends BaseApiController
{ {
public array $notNeedLogin = ['deviceAlarmCount', 'deviceCount']; public array $notNeedLogin = ['deviceAlarmCount', 'deviceCount', 'deviceDesc'];
public $areaCode; public $areaCode;
public $streetCode; public $streetCode;
@ -92,4 +92,8 @@ class DeviceController extends BaseApiController
} }
public function deviceDesc()
{
}
} }

View File

@ -180,7 +180,7 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($ambientTemperatureDevice)) { if (!empty($ambientTemperatureDevice)) {
$rangeData = self::requestRangeMonitorData($ambientTemperatureDevice); $rangeData = self::requestRangeMonitorData($ambientTemperatureDevice);
if (!empty($rangeData)) { if (!empty($rangeData)) {
$ambientTemperatureDevice['RangeMonitorData'] = $rangeData[4]; $ambientTemperatureDevice['RangeMonitorData'] = $rangeData[0];
} else { } else {
$ambientTemperatureDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; $ambientTemperatureDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
@ -193,7 +193,7 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($ambientHumidityDevice)) { if (!empty($ambientHumidityDevice)) {
$rangeData = self::requestRangeMonitorData($ambientHumidityDevice); $rangeData = self::requestRangeMonitorData($ambientHumidityDevice);
if (!empty($rangeData)) { if (!empty($rangeData)) {
$ambientHumidityDevice['RangeMonitorData'] = $rangeData[4]; $ambientHumidityDevice['RangeMonitorData'] = $rangeData[0];
} else { } else {
$ambientHumidityDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; $ambientHumidityDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
@ -205,7 +205,7 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($NDevice)) { if (!empty($NDevice)) {
$rangeData = self::requestRangeMonitorData($NDevice); $rangeData = self::requestRangeMonitorData($NDevice);
if (!empty($rangeData)) { if (!empty($rangeData)) {
$NDevice['RangeMonitorData'] = $rangeData[4]; $NDevice['RangeMonitorData'] = $rangeData[0];
} else { } else {
$NDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; $NDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
@ -217,7 +217,7 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($fireproofDevice)) { if (!empty($fireproofDevice)) {
$rangeData = self::requestRangeMonitorData($fireproofDevice); $rangeData = self::requestRangeMonitorData($fireproofDevice);
if (!empty($rangeData)) { if (!empty($rangeData)) {
$fireproofDevice['RangeMonitorData'] = $rangeData[4]; $fireproofDevice['RangeMonitorData'] = $rangeData[0];
} else { } else {
$fireproofDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; $fireproofDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }
@ -230,7 +230,7 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($methaneDevice)) { if (!empty($methaneDevice)) {
$rangeData = self::requestRangeMonitorData($methaneDevice); $rangeData = self::requestRangeMonitorData($methaneDevice);
if (!empty($rangeData)) { if (!empty($rangeData)) {
$methaneDevice['RangeMonitorData'] = $rangeData[4]; $methaneDevice['RangeMonitorData'] = $rangeData[0];
} else { } else {
$methaneDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];; $methaneDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];;
} }
@ -243,7 +243,7 @@ class RemoteRequestLogic extends BaseLogic
if (!empty($noiseDevice)) { if (!empty($noiseDevice)) {
$rangeData = self::requestRangeMonitorData($noiseDevice); $rangeData = self::requestRangeMonitorData($noiseDevice);
if (!empty($rangeData)) { if (!empty($rangeData)) {
$noiseDevice['RangeMonitorData'] = $rangeData[4]; $noiseDevice['RangeMonitorData'] = $rangeData[0];
} else { } else {
$noiseDevice['RangeMonitorData'] = [0,0,0,0,0,0,0]; $noiseDevice['RangeMonitorData'] = [0,0,0,0,0,0,0];
} }