diff --git a/app/Command/spider/BaiduRecordCommand.php b/app/Command/spider/BaiduRecordCommand.php index 0e0142a..7a094c4 100644 --- a/app/Command/spider/BaiduRecordCommand.php +++ b/app/Command/spider/BaiduRecordCommand.php @@ -68,7 +68,10 @@ class BaiduRecordCommand extends BaseSpider if ($id) { $query = $query->where('id', $id); } - $query?->each(function($item) use (&$requestCookie, &$cache) { + + $query = $query->get(); + + foreach ($query as $index => $item) { sleep(3); try { if (!$item->platform) { @@ -111,8 +114,8 @@ class BaiduRecordCommand extends BaseSpider $this->log->info($exception->getMessage()); $this->log->info($exception->getTraceAsString()); } - - }, 10); + } + return; return; }