From 4e7f17091f35f38be231c388d7f96f7160d99608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Sat, 23 Mar 2024 15:13:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php index 17e134d..c10ee0b 100644 --- a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php +++ b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php @@ -77,8 +77,10 @@ class KuaiTuanTuan extends BusinessClient public function batchIncrQuantity($businessGoodsSkus, $num, $incremental) { $batchAppendParams = []; + $logData = []; foreach ($businessGoodsSkus as $businessGoodsSku) { [$type, $appendParams] = Goods::incrQuantity($businessGoodsSku['goods_id'], $businessGoodsSku['sku_id'], $num, $incremental ? 1 : 2); + $logData[] = $appendParams; $appendParams['type'] = $type; $appendParams['client_id'] = $this->clientId; $appendParams['timestamp'] = time(); @@ -87,7 +89,9 @@ class KuaiTuanTuan extends BusinessClient $batchAppendParams[] = $appendParams; } $this->batchAsyncPostRequest('https://gw-api.pinduoduo.com/api/router', $batchAppendParams); - Log::info('本次批量同步: ' . json_encode($appendParams, 256)); + if ($logData) { + Log::info('本次批量同步: ' . json_encode($logData, 256)); + } } /**