From 1ac6d61217c08f5135a796ebee281e7c2bbd05b7 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 17:19:03 +0800 Subject: [PATCH] 1 --- app/api/controller/food/User.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/api/controller/food/User.php b/app/api/controller/food/User.php index 5d47f83..c68f924 100644 --- a/app/api/controller/food/User.php +++ b/app/api/controller/food/User.php @@ -135,11 +135,14 @@ class User extends Controller public function getWxUserCoupon() { $post = $_GET; - $where = []; - if (!empty($post['openid'])) { - $where['openid'] = $post['openid']; - $openid = $post['openid']; + + if (empty($post['openid'])) { + return $this->renderError('openid错误'); + } + $where = []; + $where['openid'] = $post['openid']; + $openid = $post['openid']; if (!empty($post['coupon_id'])) { $where['coupon_user_id'] = $post['coupon_id'];