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, '成功'); }