This commit is contained in:
test_service 2023-12-08 17:17:36 +08:00
commit 607f3b9a8b

View File

@ -135,9 +135,10 @@ class User extends Controller
public function getWxUserCoupon() public function getWxUserCoupon()
{ {
$post = $_GET; $post = $_GET;
$where = [];
if (!empty($post['openid'])) { if (!empty($post['openid'])) {
$where['openid'] = $post['openid']; $where['openid'] = $post['openid'];
$openid = $post['openid'];
} }
if (!empty($post['coupon_id'])) { if (!empty($post['coupon_id'])) {
@ -147,8 +148,8 @@ class User extends Controller
} }
} }
$data = Db::name('food_coupon_user_wx')->where($where)->select(); $data = Db::name('food_coupon_user_wx')->where($where)->select();
$data['wx_openid'] = $openid ?? '';
return $this->renderSuccess($data, '成功'); return $this->renderSuccess($data, '成功');
} }