From 5c561a729513ed6d2e39f9362b8a6d1aac5133e8 Mon Sep 17 00:00:00 2001 From: menxipeng Date: Sat, 13 Sep 2025 12:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=A5=E8=AF=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/system/ShopUserMapper.xml | 8 ++++++-- ruoyi-ui/src/views/user/manage/index.vue | 13 +++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ruoyi-system/src/main/resources/mapper/system/ShopUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ShopUserMapper.xml index 3b56e6b..6a9c88b 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ShopUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ShopUserMapper.xml @@ -81,8 +81,12 @@ and user_id = #{userId} and username like concat('%', #{username}, '%') and password = #{password} - and phone = #{phone} - and nickname like concat('%', #{nickname}, '%') + + or phone like concat('%', #{phone}, '%') + + + or nickname like concat('%', #{nickname}, '%') + and sex = #{sex} and birthday = #{birthday} and addr = #{addr} diff --git a/ruoyi-ui/src/views/user/manage/index.vue b/ruoyi-ui/src/views/user/manage/index.vue index a468f8a..b1ee0a4 100644 --- a/ruoyi-ui/src/views/user/manage/index.vue +++ b/ruoyi-ui/src/views/user/manage/index.vue @@ -105,6 +105,8 @@ export default { queryParams: { pageNum: 1, pageSize: 10, + phone: null, + nickname: null, searchKey: null } }; @@ -139,11 +141,22 @@ export default { /** 搜索按钮操作 */ handleQuery() { this.queryParams.pageNum = 1; + // 如果有搜索关键字,同时设置手机号和昵称参数 + if (this.queryParams.searchKey) { + this.queryParams.phone = this.queryParams.searchKey; + this.queryParams.nickname = this.queryParams.searchKey; + } else { + this.queryParams.phone = null; + this.queryParams.nickname = null; + } this.getList(); }, /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); + this.queryParams.phone = null; + this.queryParams.nickname = null; + this.queryParams.searchKey = null; this.handleQuery(); }, /** 状态修改 */