修复查询问题

This commit is contained in:
menxipeng
2025-09-13 12:19:30 +08:00
parent b9dabf0382
commit 5c561a7295
2 changed files with 19 additions and 2 deletions

View File

@@ -81,8 +81,12 @@
<if test="userId != null "> and user_id = #{userId}</if>
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
<if test="password != null and password != ''"> and password = #{password}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="nickname != null and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
<if test="phone != null and phone != ''">
or phone like concat('%', #{phone}, '%')
</if>
<if test="nickname != null and nickname != ''">
or nickname like concat('%', #{nickname}, '%')
</if>
<if test="sex != null "> and sex = #{sex}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
<if test="addr != null and addr != ''"> and addr = #{addr}</if>

View File

@@ -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();
},
/** 状态修改 */