From 66f1d9726d77fae75940c9f898b0763b98aa7db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Mon, 24 Oct 2022 15:32:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20#100000=20=E5=AD=97=E6=AE=B5=E9=94=99?= =?UTF-8?q?=E8=AF=AF=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/Groups.php | 21 ++++++++++++++++--- .../Business/KuaiTuanTuan/KuaiTuanTuan.php | 9 +++++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/Services/Business/KuaiTuanTuan/Groups.php b/app/Services/Business/KuaiTuanTuan/Groups.php index 845f4d4..2f8c6a4 100644 --- a/app/Services/Business/KuaiTuanTuan/Groups.php +++ b/app/Services/Business/KuaiTuanTuan/Groups.php @@ -4,6 +4,7 @@ namespace App\Services\Business\KuaiTuanTuan; use App\Models\Groups as GroupsModel; use App\Models\GroupGoods; +use App\Utils\DateTimeUtils; class Groups { @@ -23,18 +24,18 @@ class Groups 'goods_name' => $item['goods_name'], 'limit_buy' => $item['limit_buy'], 'market_price' => $item['market_price'], - 'sku_list' => [ + 'sku_list' => [[ 'external_sku_id' => $item['external_sku_id'], 'price_in_fen' => $item['price_in_fen'], 'quantity_type' => 0, 'spec_id_list' => [], 'total_quantity' => $item['goodsSku']['stock'], - ] + ]] ]; } $appendParams = [ 'end_time' => $group->getOriginal('end_time'), - 'goods_list' => json_encode([$goodsSkus]), + 'goods_list' => json_encode($goodsSkus, 256), 'is_save_preview' => $group['is_save_preview'], 'start_time' => $group->getOriginal('start_time'), 'title' => $group['title'], @@ -53,5 +54,19 @@ class Groups return [$type, $appendParams]; } + + public static function queryGroup() + { + $type = 'pdd.ktt.group.query.list'; + $time = DateTimeUtils::getMicroTime(); + $appendParams = [ + 'end_update_time' => $time, + 'page' => 1, + 'size' => 10, + 'start_update_time' => $time - 3600 * 24 * 6 * 1000 + ]; + + return [$type, $appendParams]; + } } diff --git a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php index a9ea4c8..a6be8e8 100644 --- a/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php +++ b/app/Services/Business/KuaiTuanTuan/KuaiTuanTuan.php @@ -129,7 +129,7 @@ class KuaiTuanTuan extends BusinessClient } else { // throw new \RuntimeException($res['error_response']['error_msg'] . ':' . $res['error_response']['error_msg']); } - Log::info(json_encode($res,256)); + Log::info(json_encode($res, 256)); } return $res; @@ -198,4 +198,11 @@ class KuaiTuanTuan extends BusinessClient return $res; } + + public function queryGroup() + { + [$type, $appendParams] = Groups::queryGroup(); + + return $this->doRequest($type, $appendParams); + } }