This commit is contained in:
test_service 2023-12-08 17:12:50 +08:00
commit d5fd6f6803

View File

@ -134,16 +134,20 @@ class User extends Controller
*/ */
public function getWxUserCoupon() public function getWxUserCoupon()
{ {
$post = $this->request->get(); $post = $_GET;
if (isset($post['coupon_id'])) { if (!empty($post['openid'])) {
$where['coupon_user_id'] = $post['coupon_id'];
}
if (isset($post['openid'])) {
$where['openid'] = $post['openid']; $where['openid'] = $post['openid'];
} }
if (!empty($post['coupon_id'])) {
$where['coupon_user_id'] = $post['coupon_id'];
if (!empty($where['openid'])) {
unset($where['openid']);
}
}
$data = Db::name('food_coupon_user_wx')->where($where)->select(); $data = Db::name('food_coupon_user_wx')->where($where)->select();
return $this->renderSuccess($data, '成功'); return $this->renderSuccess($data, '成功');
} }