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); }