From 91f7b524fec4355f62be86f9df27f677076b99ae Mon Sep 17 00:00:00 2001 From: Jing Li Date: Wed, 29 Nov 2023 11:24:07 +0800 Subject: [PATCH] Fix --- app/Console/Commands/BiAng/DeviceLogSyncCommand.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Console/Commands/BiAng/DeviceLogSyncCommand.php b/app/Console/Commands/BiAng/DeviceLogSyncCommand.php index 4cd1222..8c48b65 100644 --- a/app/Console/Commands/BiAng/DeviceLogSyncCommand.php +++ b/app/Console/Commands/BiAng/DeviceLogSyncCommand.php @@ -102,6 +102,9 @@ class DeviceLogSyncCommand extends Command $data = $httpClient->getLatestSoilReport($device->sn); if (empty($data)) { + $device->update([ + 'status' => DeviceStatus::Offline, + ]); $this->warn('设备数据为空'); break; } @@ -122,6 +125,9 @@ class DeviceLogSyncCommand extends Command $data = $httpClient->getLatestMeteorologicalReport($device->sn); if (empty($data)) { + $device->update([ + 'status' => DeviceStatus::Offline, + ]); $this->warn('设备数据为空'); break; } @@ -142,6 +148,9 @@ class DeviceLogSyncCommand extends Command $data = $httpClient->getLatestLampReport($device->sn); if (empty($data)) { + $device->update([ + 'status' => DeviceStatus::Offline, + ]); $this->warn('设备数据为空'); break; } @@ -167,6 +176,9 @@ class DeviceLogSyncCommand extends Command $data = $httpClient->getWormPhotos($device->sn, $now->copy()->subHours(24), $now); if (empty($data)) { + $device->update([ + 'status' => DeviceStatus::Offline, + ]); $this->warn('设备数据为空'); break; }