Jing Li 2023-11-29 11:24:07 +08:00
parent e0e9850812
commit 91f7b524fe
1 changed files with 12 additions and 0 deletions

View File

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