From 3a1c786f93c7d6a8291d34e8a8922a9059ed6af6 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:17:23 +0800 Subject: [PATCH] 1 --- app/api/controller/food/User.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/api/controller/food/User.php b/app/api/controller/food/User.php index 861c0ae..5d47f83 100644 --- a/app/api/controller/food/User.php +++ b/app/api/controller/food/User.php @@ -135,9 +135,10 @@ class User extends Controller public function getWxUserCoupon() { $post = $_GET; - + $where = []; if (!empty($post['openid'])) { $where['openid'] = $post['openid']; + $openid = $post['openid']; } if (!empty($post['coupon_id'])) { @@ -147,8 +148,8 @@ class User extends Controller } } - $data = Db::name('food_coupon_user_wx')->where($where)->select(); + $data['wx_openid'] = $openid ?? ''; return $this->renderSuccess($data, '成功'); }