From 4a750a6007c8dac9868188618fdcb61e24e432c8 Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Sat, 25 May 2019 16:47:49 +0800 Subject: [PATCH] wx pay --- .../weixinwebauthorization/index/Auth.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/application/plugins/weixinwebauthorization/index/Auth.php b/application/plugins/weixinwebauthorization/index/Auth.php index 34cf8062e..5f2df62c5 100644 --- a/application/plugins/weixinwebauthorization/index/Auth.php +++ b/application/plugins/weixinwebauthorization/index/Auth.php @@ -33,6 +33,15 @@ class Auth extends Controller */ public function Pay($params = []) { + // 订单url处理 + if(!empty($params['id'])) + { + $is_pay_auto = isset($params['is_pay_auto']) ? intval($params['is_pay_auto']) : 0; + $url = MyUrl('index/order/detail', ['id'=>intval($params['id']), 'is_pay_auto'=>$is_pay_auto]); + session('plugins_pay_order_detail_url', $url); + } + + // 调用授权 return $this->Index($params); } @@ -108,6 +117,15 @@ class Auth extends Controller $ret = Service::WeixinAuthBind($ret['data']); if($ret['code'] == 0) { + // 是否订单支付授权,进入订单详情 + $url = session('plugins_pay_order_detail_url'); + if(!empty($url)) + { + session('plugins_pay_order_detail_url', null); + return redirect($url); + } + + // 默认页面提示 $this->assign('msg', $ret['msg']); $this->assign('data', $ret['data']); return $this->fetch('../../../plugins/view/weixinwebauthorization/index/public/success');