From 6fa19ce2eb9243711e453f95b37c2b34c3424fa1 Mon Sep 17 00:00:00 2001 From: liuyuhang Date: Tue, 9 Jul 2024 10:14:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=8E=E5=9B=A2=E8=AE=A2=E5=8D=95=E7=88=AC?= =?UTF-8?q?=E8=99=AB=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=AF=8F=E6=AC=A1=E7=88=AC?= =?UTF-8?q?=E5=8F=96=E6=8C=87=E5=AE=9A=E5=A4=A9=E6=95=B0=E5=86=85=E7=9A=84?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=EF=BC=8C=E4=B8=94=E5=8F=AA=E7=88=AC=E5=8F=96?= =?UTF-8?q?10=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/app/command/SpiderMt.php | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/service/app/command/SpiderMt.php b/service/app/command/SpiderMt.php index a4a2b7f0..35132e45 100644 --- a/service/app/command/SpiderMt.php +++ b/service/app/command/SpiderMt.php @@ -180,14 +180,19 @@ class SpiderMt extends Command // return 1; // sleep(5); - $time = strtotime(date('Y-m-d')); - for ($i = 0; $i <= $d; $i++) { - $day = $time - $i * 24 * 3600; - $start = date('Y-m-d', $day); - $end = date('Y-m-d 23:59:59', $day); - $this->orders($start, $end, false); - // $this->_kuaishouOrder($start, $end, false); - } + + // $time = strtotime(date('Y-m-d')); + // for ($i = 0; $i <= $d; $i++) { + // $day = $time - $i * 24 * 3600; + // $start = date('Y-m-d', $day); + // $end = date('Y-m-d 23:59:59', $day); + // $this->orders($start, $end, false); + // // $this->_kuaishouOrder($start, $end, false); + // } + + $start = date('Y-m-d 00:00:00', strtotime("-{$d} days")); + $end = date('Y-m-d 23:59:59'); + $this->orders($start, $end, false); if (date('H') >= 1 && date('H') <= 7) { $this->reload($output); @@ -332,7 +337,12 @@ class SpiderMt extends Command try { $mei = new Meituan(); $list = $mei->get($page, $start, $end); - $pages = $mei->totalPage; + // $pages = $mei->totalPage; + + if ($mei->totalPage === 1) { + $pages = 1; + } + } catch (\Exception $e) { Log::error(dirname(__FILE__) . __LINE__ . $e); }