From 1fc01b40609355bd59eb50222e89aec64432b95c Mon Sep 17 00:00:00 2001 From: liapples Date: Tue, 2 Nov 2021 23:56:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0exists=5Fupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Collector.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Console/Commands/Collector.php b/app/Console/Commands/Collector.php index ac040f1..027bbde 100644 --- a/app/Console/Commands/Collector.php +++ b/app/Console/Commands/Collector.php @@ -118,6 +118,10 @@ class Collector extends Command if (!preg_match('/\/(\d+)\.html/', $url, $match)) continue; $id = $match[1]; + if ($this->exists_update == false && CollectProduct::where(['unique_id' => $id, 'site' => 1])->exists()) { + continue; + } + $inc_sales = $http->post('https://m.mafengwo.cn/poi/poi/inc_sales', ['poiid' => $id]); preg_match('#(\d+)#', $inc_sales['html'] ?? '', $match_price);