chunk(100, function ($hosts) { foreach ($hosts as $host) { // 忽略维护中的模块 if ($host->module->status !== 'up') { continue; } $host->updateOrDelete(); } }); } }