From f8d64129b2bd5d5bf485a55a4f5a2598b6dee317 Mon Sep 17 00:00:00 2001 From: denghy Date: Fri, 8 Feb 2019 08:24:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Domains/Real/Commands/Sync/MongoSync.php | 8 ++------ app/Domains/Virtual/Commands/Sync/CardSync.php | 8 ++------ app/Domains/Virtual/Commands/Sync/LogSync.php | 8 ++------ 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/app/Domains/Real/Commands/Sync/MongoSync.php b/app/Domains/Real/Commands/Sync/MongoSync.php index 61f49809..3f9cc881 100644 --- a/app/Domains/Real/Commands/Sync/MongoSync.php +++ b/app/Domains/Real/Commands/Sync/MongoSync.php @@ -36,17 +36,13 @@ class MongoSync extends Command Artisan::call('real:sync-bloc'); } - $page = 1; + $page = 2; $jobs = new Collection(); - while ($total) { + while ($total && ($page - 1) * $this->limit > $total) { $jobs->push(new MongoSyncJob($page, $this->limit, $utcDateTime)); - if ($page * $this->limit >= $total) { - break; - } - $page++; } diff --git a/app/Domains/Virtual/Commands/Sync/CardSync.php b/app/Domains/Virtual/Commands/Sync/CardSync.php index 34a28ab3..bf031ec3 100644 --- a/app/Domains/Virtual/Commands/Sync/CardSync.php +++ b/app/Domains/Virtual/Commands/Sync/CardSync.php @@ -38,17 +38,13 @@ class CardSync extends Command Artisan::call('real:sync-bloc'); } - $page = 1; + $page = 2; $jobs = new Collection(); - while ($total) { + while ($total && ($page - 1) * $this->limit > $total) { $jobs->push(new CardSyncJob($page, $this->limit, $maxId)); - if ($page * $this->limit >= $total) { - break; - } - $page++; } diff --git a/app/Domains/Virtual/Commands/Sync/LogSync.php b/app/Domains/Virtual/Commands/Sync/LogSync.php index 35105931..bfdd27e7 100644 --- a/app/Domains/Virtual/Commands/Sync/LogSync.php +++ b/app/Domains/Virtual/Commands/Sync/LogSync.php @@ -44,17 +44,13 @@ class LogSync extends Command Artisan::call('virtual:sync-product'); } - $page = 1; + $page = 2; $jobs = new Collection(); - while ($total) { + while ($total && ($page - 1) * $this->limit > $total) { $jobs->push(new LogSyncJob($page, $this->limit, $maxId)); - if ($page * $this->limit >= $total) { - break; - } - $page++; }