1
0
Fork 0

修复 SQL 查询 N+1

develop
李静 2023-05-06 10:16:38 +08:00
parent 4646f1fd16
commit c551bcafeb
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ class DeviceLogSyncCommand extends Command
protected function performSync(Carbon $start, Carbon $end): void
{
/** @var \Illuminate\Database\Eloquent\Collection */
$devices = Device::poweredBy($this->argument('factory'))->get();
$devices = Device::with(['factory'])->poweredBy($this->argument('factory'))->get();
foreach ($devices as $device) {
$this->info('==========================================');