From 900acafc8c5f73b97c778f8d2817ac4871df8aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=96=E5=8F=AB?= <392494244@qq.com> Date: Fri, 8 Dec 2023 16:27:10 +0800 Subject: [PATCH] 1 --- app/api/controller/food/User.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/api/controller/food/User.php b/app/api/controller/food/User.php index 7bdb1ae..7dd91e9 100644 --- a/app/api/controller/food/User.php +++ b/app/api/controller/food/User.php @@ -181,6 +181,7 @@ class User extends Controller } + //扫码重定向 public function wxCode() { $coupon_id = $this->request->get('coupon_id') ?? ''; @@ -216,7 +217,15 @@ class User extends Controller 'openid' => $openid, 'redirect_uri' => 'https://app.cxhxy.dev.1nww.com/#/pages/details/details' ]; - return redirect(urlencode('https://app.cxhxy.dev.1nww.com/#/pages/details/details?openid=' . $openid . '&coupon_id=' . $coupon_id)); + + if (isset($coupon_id)) { + //优惠券详情 + $url = 'https://app.cxhxy.h5.dev.1nww.com/#/pages/details/details?openid=' . $openid . '&coupon_id=' . $coupon_id; + } else { + //优惠券列表 + $url = 'https://app.cxhxy.h5.dev.1nww.com/#/pages/index?openid=' . $openid; + } + return redirect($url); } } return $this->renderError('授权失败');