通风设备数据部同步
parent
aec3b6a338
commit
132c36e9ef
|
|
@ -63,7 +63,13 @@ class DeviceLogSyncCommand extends Command
|
||||||
/** @var \Illuminate\Database\Eloquent\Collection */
|
/** @var \Illuminate\Database\Eloquent\Collection */
|
||||||
$devices = Device::with(['factory'])->poweredBy($factory)->get();
|
$devices = Device::with(['factory'])->poweredBy($factory)->get();
|
||||||
|
|
||||||
|
/** @var \App\Models\Device */
|
||||||
foreach ($devices as $device) {
|
foreach ($devices as $device) {
|
||||||
|
// 忽略通风设备
|
||||||
|
if ($device->isTypeAir()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$this->info('==========================================');
|
$this->info('==========================================');
|
||||||
$this->info('设备编号: ' . $device->sn);
|
$this->info('设备编号: ' . $device->sn);
|
||||||
$this->info('设备名称: ' . $device->name);
|
$this->info('设备名称: ' . $device->name);
|
||||||
|
|
|
||||||
|
|
@ -87,4 +87,9 @@ class Device extends Model
|
||||||
{
|
{
|
||||||
return $this->type === static::TYPE_METEOROLOGICAL;
|
return $this->type === static::TYPE_METEOROLOGICAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTypeAir(): bool
|
||||||
|
{
|
||||||
|
return $this->type === static::TYPE_AIR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue