1
0
Fork 0

通风设备数据部同步

develop
李静 2023-07-17 13:50:17 +08:00
parent aec3b6a338
commit 132c36e9ef
2 changed files with 11 additions and 0 deletions

View File

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

View File

@ -87,4 +87,9 @@ class Device extends Model
{
return $this->type === static::TYPE_METEOROLOGICAL;
}
public function isTypeAir(): bool
{
return $this->type === static::TYPE_AIR;
}
}