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; }