From 5e9b69dc0f9cf0303ece47893dc225c2ace2f9a0 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 15:30:57 +0800 Subject: [PATCH] 1 --- app/api/controller/food/User.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/api/controller/food/User.php b/app/api/controller/food/User.php index 9ab261e..6901cf5 100644 --- a/app/api/controller/food/User.php +++ b/app/api/controller/food/User.php @@ -171,10 +171,21 @@ class User extends Controller return $this->renderSuccess($data, '成功'); } + + public function is_write() + { + $get = $this->request->get(); + $user = Db::name('user_wx')->where(['wx_openid' => $get['openid']])->value('is_role'); + $write_status = empty($user) || $user == 0 ? 0 : 1; + return $this->renderSuccess($write_status, '成功'); + } + + public function wxCode() { + $coupon_id = $this->request->get('id'); $appid = 'wx89c12dd426a55a2e'; - $redirect_uri = 'https://app.cxhxy.dev.1nww.com/#/pages/details/detail'; + $redirect_uri = 'https://app.cxhxy.dev.1nww.com/#/pages/details/detail?coupon=' . $coupon_id; $url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"; return $this->renderSuccess($url, '成功'); }