From 2a21131a440134119bcc1ef55e088191fe1326e8 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Mon, 6 May 2024 22:31:41 +0800 Subject: [PATCH] 1 --- app/common/library/wxserver/Wholesaler.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/common/library/wxserver/Wholesaler.php b/app/common/library/wxserver/Wholesaler.php index beab49fd..ae975a19 100644 --- a/app/common/library/wxserver/Wholesaler.php +++ b/app/common/library/wxserver/Wholesaler.php @@ -74,6 +74,18 @@ class Wholesaler return $data; } + public function applySetOrderPathInfo(array $appid, string $path = 'pages/order/index') + { + $token = $this->getComponentAccessToken(); + $data['batch_req'] = [ + 'path' => $path, + 'appid_list' => $appid, + ]; + $url = "https://api.weixin.qq.com/wxa/security/applysetorderpathinfo?component_access_token=$token"; + $result = $this->curlPost($url, json_encode($data)); + return json_decode($result, true); + } + public function getStableAccessToken() { $url = 'https://api.weixin.qq.com/cgi-bin/stable_token'; @@ -631,6 +643,8 @@ class Wholesaler if ($this->modifyJumpDomain($appid)) { $up['jump_domain_status'] = 1; } + //设置订单页path信息 + $this->applySetOrderPathInfo([$appid]); if ($up) { $model = new WxwholesalerAccount(); $model->update($up, ['appid' => $appid]);