From 79a5caa5911aa5d181ef998d4c4e016339548384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Fri, 26 Aug 2022 14:09:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20#10000=20=E5=A2=9E=E9=87=8F?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=8E=B7=E5=8F=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Swoole.php | 4 ++-- app/Listeners/UpdateBusinessGoodsStock.php | 2 +- app/Services/Business/KuaiTuanTuan/Goods.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/Swoole.php b/app/Console/Commands/Swoole.php index c58160a..9b4b06c 100644 --- a/app/Console/Commands/Swoole.php +++ b/app/Console/Commands/Swoole.php @@ -43,10 +43,10 @@ class Swoole extends Command */ public function handle() { - Timer::tick(1000, function () { + Timer::tick(5000, function () { $shops = Shop::query()->where('plat_id', 1)->where('status', 1)->get(); $endTime = DateTimeUtils::getMicroTime(); - $beginTime = $endTime - 10000; + $beginTime = $endTime - 50000; foreach ($shops as $shop) { BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime, 'increment'); } diff --git a/app/Listeners/UpdateBusinessGoodsStock.php b/app/Listeners/UpdateBusinessGoodsStock.php index a05be02..fe97d23 100644 --- a/app/Listeners/UpdateBusinessGoodsStock.php +++ b/app/Listeners/UpdateBusinessGoodsStock.php @@ -40,7 +40,7 @@ class UpdateBusinessGoodsStock implements ShouldQueue $log->target_id = $event->goodsSku->id ?? 0; $log->target_field = 'stock'; $log->user_id = 999; - $log->message = ($event->businessOrderItem['external_sku_id'] ?? $event->businessOrderItem['id']) . '未找到'; + $log->message = '未找到' . json_encode($event->businessOrderItem, 256); $log->save(); return; diff --git a/app/Services/Business/KuaiTuanTuan/Goods.php b/app/Services/Business/KuaiTuanTuan/Goods.php index f3613b6..83b0d82 100644 --- a/app/Services/Business/KuaiTuanTuan/Goods.php +++ b/app/Services/Business/KuaiTuanTuan/Goods.php @@ -56,7 +56,7 @@ class Goods $type = 'pdd.ktt.goods.incr.quantity'; $appendParams = [ 'goods_id' => $goodsId, - 'quantity_delta' => $quantity, + 'quantity_delta' => max($quantity, 0), 'sku_id' => $skuId, // 非必填 'modify_quantity_type' => $modifyType, // 修改库存的类型,不传或1代表增量修改,2代表全量修改 From 1787b4c355c429f923b7cc975830cddc02bf6903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Fri, 26 Aug 2022 14:12:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20#10000=20=E5=A2=9E=E9=87=8F?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=8E=B7=E5=8F=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Swoole.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Commands/Swoole.php b/app/Console/Commands/Swoole.php index 9b4b06c..e7e8bb9 100644 --- a/app/Console/Commands/Swoole.php +++ b/app/Console/Commands/Swoole.php @@ -46,7 +46,7 @@ class Swoole extends Command Timer::tick(5000, function () { $shops = Shop::query()->where('plat_id', 1)->where('status', 1)->get(); $endTime = DateTimeUtils::getMicroTime(); - $beginTime = $endTime - 50000; + $beginTime = $endTime - 5000; foreach ($shops as $shop) { BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime, 'increment'); }