From 45ed0c0463d4be6bf01394f5cd640f45504f3395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E4=B8=96=E7=95=8C?= <642747453@qq.com> Date: Wed, 26 Apr 2023 18:16:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20#10000=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Test.php | 1 + .../Business/BusinessGoodsSkusController.php | 5 +- app/Services/Business/BusinessClient.php | 6 +-- .../Business/KuaiTuanTuan/FaceSheet.php | 49 +++++++++++++++++++ 4 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 app/Services/Business/KuaiTuanTuan/FaceSheet.php diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index a332fe4..658154a 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -12,6 +12,7 @@ use App\Models\Log; use App\Models\Shop; use App\Models\TodayPrice; use App\Services\Business\BusinessFactory; +use App\Services\Business\KuaiTuanTuan\FaceSheet; use App\Utils\DateTimeUtils; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; diff --git a/app/Http/Controllers/Business/BusinessGoodsSkusController.php b/app/Http/Controllers/Business/BusinessGoodsSkusController.php index 6280b78..80db651 100644 --- a/app/Http/Controllers/Business/BusinessGoodsSkusController.php +++ b/app/Http/Controllers/Business/BusinessGoodsSkusController.php @@ -155,17 +155,16 @@ class BusinessGoodsSkusController extends Controller if (!isset($res['ktt_group_query_list_response'])) { continue; } - $activityNos = $activities = []; + $activities = []; foreach ($res['ktt_group_query_list_response']['activity_list'] as $activity) { $title = str_replace(' ', '', $activity['title']); if (0 === $activity['is_help_sell'] && !in_array($title, $noActivityTitle, true)) { - $activityNos[] = $activity['activity_no']; $activities[$activity['activity_no']] = $activity['title']; } } $businessGoodsSkus = BusinessGoodsSku::query() ->where('shop_id', $shop->id) - ->whereIn('activity_no', $activityNos) + ->whereIn('activity_no', array_keys($activities)) ->orderBy('activity_no') ->get(['shop_id', 'title', 'activity_no', 'goods_name', 'price_in_fen', 'external_sku_id']); if ($businessGoodsSkus->isEmpty()) { diff --git a/app/Services/Business/BusinessClient.php b/app/Services/Business/BusinessClient.php index 238eef7..0870461 100644 --- a/app/Services/Business/BusinessClient.php +++ b/app/Services/Business/BusinessClient.php @@ -164,7 +164,6 @@ abstract class BusinessClient public function batchAsyncPostRequest($url, $batchParams) { - LogFile::info(json_encode($batchParams, 256)); $client = new Client(); $promises = []; foreach ($batchParams as $param) { @@ -174,9 +173,6 @@ abstract class BusinessClient ]; $promises[] = $client->postAsync($url, $options); } - $res = Promise\Utils::unwrap($promises); - foreach ($res as $item) { - LogFile::info($item->getBody()->getContents()); - } + Promise\Utils::unwrap($promises); } } diff --git a/app/Services/Business/KuaiTuanTuan/FaceSheet.php b/app/Services/Business/KuaiTuanTuan/FaceSheet.php new file mode 100644 index 0000000..a635383 --- /dev/null +++ b/app/Services/Business/KuaiTuanTuan/FaceSheet.php @@ -0,0 +1,49 @@ +doRequest($type, $appendParams); + } + + /** + * searchWayBill + * + * @return mixed + */ + public function searchWayBill() + { + $type = 'pdd.waybill.search'; + $appendParams = []; + + return $this->doRequest($type, $appendParams); + } + + public function getLogisticsOrderTrance() + { + $type = 'pdd.logistics.ordertrace.get'; + $appendParams = []; + + return $this->doRequest($type, $appendParams); + } + + public function test() + { + $type = 'pdd.cloudprint.stdtemplates.get'; + $appendParams = []; + + return $this->doRequest($type, $appendParams); + } +} +