From 5898eef8ff6ef37798772d6c958e4d5df5300957 Mon Sep 17 00:00:00 2001 From: Gosowong <1329847115@qq.com> Date: Tue, 23 May 2023 17:08:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=94=B6=E8=B4=A7=20=E4=BF=AE=E6=94=B9=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=B7=AF=E5=8A=B2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/v1/setting/SystemConfig.php | 9 +++++++-- .../orderShipping/MiniOrderService.php | 4 ++-- .../easywechat/orderShipping/OrderClient.php | 19 ++++++++++++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php b/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php index d2716ad7c..fdfe3188c 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php +++ b/crmeb/app/adminapi/controller/v1/setting/SystemConfig.php @@ -14,6 +14,7 @@ use app\adminapi\controller\AuthController; use app\Request; use app\services\system\config\SystemConfigServices; use app\services\system\config\SystemConfigTabServices; +use crmeb\services\easywechat\orderShipping\MiniOrderService; use think\facade\App; /** @@ -327,8 +328,12 @@ class SystemConfig extends AuthController @copy($from, $toHome); @copy($from, $toPublic); } - if(isset($post['reward_integral']) || isset($post['reward_money'])) { - if($post['reward_integral'] < 0 || $post['reward_money'] < 0) return app('json')->fail(400558); + if (isset($post['reward_integral']) || isset($post['reward_money'])) { + if ($post['reward_integral'] < 0 || $post['reward_money'] < 0) return app('json')->fail(400558); + } + + if (isset($post['order_shipping_open']) && $post['order_shipping_open'] == 1 && isset($post['order_shipping_url']) && $post['order_shipping_url'] !== "") { + MiniOrderService::setMesJumpPathAndCheck($post['order_shipping_url']); } foreach ($post as $k => $v) { $config_one = $this->services->getOne(['menu_name' => $k]); diff --git a/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php b/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php index 4ac8c77cc..4b343df0f 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php @@ -124,9 +124,9 @@ class MiniOrderService * @date 2023/05/10 * @author yyw */ - public static function setMesJumpPath($path) + public static function setMesJumpPathAndCheck($path) { - return self::order()->setMesJumpPath($path); + return self::order()->setMesJumpPathAndCheck($path); } diff --git a/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php b/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php index 319b64048..31040ce58 100644 --- a/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php +++ b/crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php @@ -102,7 +102,7 @@ class OrderClient extends BaseOrder ]; } // 跳转路径 - $this->setMesJumpPath($path); +// $this->setMesJumpPath($path); return $this->shipping($params); } @@ -185,6 +185,23 @@ class OrderClient extends BaseOrder return $this->notifyConfirm($params); } + /** + * 设置跳转连接 + * @param $path + * @return array + * @throws \EasyWeChat\Core\Exceptions\HttpException + * + * @date 2023/05/10 + * @author yyw + */ + public function setMesJumpPathAndCheck($path) + { + if (!$this->checkManaged()) { + throw new AdminException('开通小程序订单管理服务后重试'); + } + return $this->setMesJumpPath($path); + } + /** * 设置小程序管理服务开通状态 * @return bool