Fix
parent
3d403653a5
commit
547f0796ba
|
|
@ -64,6 +64,7 @@ class WormReportCommand extends Command
|
|||
$this->info('==================================');
|
||||
$this->info('尝试更新设备状态...');
|
||||
$realTimeData = $client->realTimeData($devices->pluck('sn')->all());
|
||||
|
||||
foreach ($realTimeData as $item) {
|
||||
foreach ($devices as $device) {
|
||||
if ($item['deviceAddr'] != $device->sn) {
|
||||
|
|
@ -71,7 +72,7 @@ class WormReportCommand extends Command
|
|||
}
|
||||
// 更新设备状态
|
||||
$device->update([
|
||||
'state' => $item['status'] === 'online' ? DeviceStatus::Online : DeviceStatus::Offline,
|
||||
'status' => $item['status'] === 'online' ? DeviceStatus::Online : DeviceStatus::Offline,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue