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