diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index af4286c..348af78 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -2,6 +2,7 @@ namespace App\Console\Commands; +use App\Models\GoodsSku; use App\Models\Shop; use App\Services\Business\BusinessFactory; use App\Utils\DateTimeUtils; @@ -40,9 +41,14 @@ class Test extends Command */ public function handle() { - $shop = Shop::query()->find(2); - $business = BusinessFactory::init()->make($shop->plat_id); - $business->setShop($shop); + // 下架商品 +// GoodsSku::where('status', '<>', 0)->update(['status' => 0]); +// $this->info('全部下架'); +// exit(); + // 1-7 11 +// $shop = Shop::query()->find(11); +// $business = BusinessFactory::init()->make($shop->plat_id); +// $business->setShop($shop); // 下载商品列表 // $business->downloadGoodsListAndBind(); @@ -53,10 +59,19 @@ class Test extends Command // $business->incrQuantity(1); // 订单下载 - $beginTime = DateTimeUtils::getMicroTime('2022-08-22 18:16:18'); - $endTime = DateTimeUtils::getMicroTime('2022-08-22 18:16:20'); - $business->downloadOrdersAndSave($beginTime, $endTime); +// $beginTime = DateTimeUtils::getMicroTime('2022-08-23 00:00:00'); +// $endTime = DateTimeUtils::getMicroTime('2022-08-24 00:00:00'); +// $business->downloadOrdersAndSave($beginTime, $endTime); - $this->info('执行测试成功'); +// $shops = Shop::query()->where('status', 1)->get(); +// $that = $this; +// foreach ($shops as $shop) { +// $business = BusinessFactory::init()->make($shop->plat_id); +// $business->setShop($shop); +// $beginTime = DateTimeUtils::getMicroTime('2022-08-10 00:00:00'); +// $endTime = DateTimeUtils::getMicroTime('2022-08-11 00:00:00'); +// $business->downloadOrdersAndSave($beginTime, $endTime); +// $that->info($shop->name); +// } } } diff --git a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php index ab7ff27..8b11707 100644 --- a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php +++ b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php @@ -61,7 +61,7 @@ class KuaiTuanTuan extends BusinessClient } /** - * 下载没有发起售后,未取消的订单 + * 下载订单 * * @param $beginTime * @param $endTime @@ -81,8 +81,8 @@ class KuaiTuanTuan extends BusinessClient $res = $this->doRequest($type, $appendParams); $this->saveOrders($res[$responseName]['order_list']); $pageNum = ceil($res[$responseName]['total_count'] / $appendParams['page_size']); - if ($pageNum > $page && 10 >= $page) { - $this->downloadOrdersAndSave($beginTime, $endTime, $page + 1); + if ($pageNum > $page && 30 >= $page) { + $this->downloadOrdersAndSave($beginTime, $endTime, $downloadType, $page + 1); } }