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'];