From f63219793f96c22c80999ef0205a2e6e5b30a2f7 Mon Sep 17 00:00:00 2001 From: toom1996 Date: Wed, 30 Jul 2025 15:49:44 +0800 Subject: [PATCH] update --- app/Command/spider/BaiduRecordCommand.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; }