From 740504224746acd472a2c65fbe7804a80a11d1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Wed, 21 Oct 2026 11:49:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8):=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=85=85=E5=80=BC=E6=AC=A1=E6=95=B0=E7=AD=9B?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后端查询、参数接收与前端表单同步移除 --- .../controller/user/UserController.php | 1 - backend/app/dao/user/UserWechatUserDao.php | 34 ++----------------- frontend/admin/src/pages/user/list/index.vue | 17 ---------- 3 files changed, 2 insertions(+), 50 deletions(-) diff --git a/backend/app/adminapi/controller/user/UserController.php b/backend/app/adminapi/controller/user/UserController.php index a051afd6a..8a4276937 100644 --- a/backend/app/adminapi/controller/user/UserController.php +++ b/backend/app/adminapi/controller/user/UserController.php @@ -66,7 +66,6 @@ class UserController extends AuthController ['before_pay_time', ''], ['pay_count_num', []], ['pay_count_money', []], - ['recharge_count', []], ['agent_level', 0], ]); $where['label_id'] = toIntArray($where['label_id']); diff --git a/backend/app/dao/user/UserWechatUserDao.php b/backend/app/dao/user/UserWechatUserDao.php index 9da2af795..04de9fd70 100644 --- a/backend/app/dao/user/UserWechatUserDao.php +++ b/backend/app/dao/user/UserWechatUserDao.php @@ -273,45 +273,15 @@ class UserWechatUserDao extends BaseDao } } - // --- 充值次数筛选 (区间) --- - // recharge_count: [min, max] 统计 user_recharge 表中的记录数 - if (isset($where['recharge_count']) && count($where['recharge_count']) == 2) { - $min = $where['recharge_count'][0]; - $max = $where['recharge_count'][1]; - - if ($min !== '' || $max !== '') { - $model = $model->where(function ($query) use ($userAlias, $min, $max) { - // 子查询:通过分组统计充值记录数 - $query->whereExists(function ($q) use ($userAlias, $min, $max) { - $q->name('user_recharge') - ->whereColumn('uid', $userAlias . 'uid') - ->field('uid') - ->group('uid') - ->having('COUNT(*) BETWEEN ' . (int)$min . ' AND ' . (int)$max); - }); - - // 特殊处理:包含无充值记录的用户 - if ($min === '' || $min == 0) { - $query->whereOr(function ($q) use ($userAlias) { - $q->whereNotExists(function ($sub) use ($userAlias) { - $sub->name('user_recharge') - ->whereColumn('uid', $userAlias . 'uid'); - }); - }); - } - }); - } - } - // --- 余额筛选 (区间) --- // balance: [min, max] if (isset($where['balance']) && count($where['balance']) == 2) { if ($where['balance'][0] !== '' && $where['balance'][1] !== '') { $model = $model->whereBetween($userAlias . 'now_money', $where['balance']); } elseif ($where['balance'][0] !== '' && $where['balance'][1] === '') { - $model = $model->where($userAlias . 'now_money', '>', $where['balance'][0]); + $model = $model->where($userAlias . 'now_money', '>=', $where['balance'][0]); } elseif ($where['balance'][0] === '' && $where['balance'][1] !== '') { - $model = $model->where($userAlias . 'now_money', '<', $where['balance'][1]); + $model = $model->where($userAlias . 'now_money', '<=', $where['balance'][1]); } } diff --git a/frontend/admin/src/pages/user/list/index.vue b/frontend/admin/src/pages/user/list/index.vue index 93f98e084..255aa3388 100644 --- a/frontend/admin/src/pages/user/list/index.vue +++ b/frontend/admin/src/pages/user/list/index.vue @@ -129,21 +129,6 @@ class="form_range_content_width" /> - - - ~ - - @@ -486,7 +471,6 @@ const userFrom = ref({ balance: ['', ''], integral: ['', ''], pay_count_money: ['', ''], - recharge_count: ['', ''], user_time_type: '', user_time: '', before_pay_time: '', @@ -998,7 +982,6 @@ function reset(name) { balance: ['', ''], integral: ['', ''], pay_count_money: ['', ''], - recharge_count: ['', ''], user_time_type: '', user_time: '', before_pay_time: '',