diff --git a/app/Console/Commands/DeviceLogSyncCommand.php b/app/Console/Commands/DeviceLogSyncCommand.php index 28020b0..02bc61c 100644 --- a/app/Console/Commands/DeviceLogSyncCommand.php +++ b/app/Console/Commands/DeviceLogSyncCommand.php @@ -63,7 +63,13 @@ class DeviceLogSyncCommand extends Command /** @var \Illuminate\Database\Eloquent\Collection */ $devices = Device::with(['factory'])->poweredBy($factory)->get(); + /** @var \App\Models\Device */ foreach ($devices as $device) { + // 忽略通风设备 + if ($device->isTypeAir()) { + continue; + } + $this->info('=========================================='); $this->info('设备编号: ' . $device->sn); $this->info('设备名称: ' . $device->name); diff --git a/app/Models/Device.php b/app/Models/Device.php index 0afe60b..4ed8252 100644 --- a/app/Models/Device.php +++ b/app/Models/Device.php @@ -87,4 +87,9 @@ class Device extends Model { return $this->type === static::TYPE_METEOROLOGICAL; } + + public function isTypeAir(): bool + { + return $this->type === static::TYPE_AIR; + } }