后台管理条件查询bug修复

This commit is contained in:
linfeng 2022-11-10 13:58:43 +08:00
parent c70fdd64d4
commit d7b8723479
2 changed files with 10 additions and 10 deletions

View File

@ -80,8 +80,9 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
//模糊查询
String key = (String) params.get("key");
if (!ObjectUtil.isEmpty(key)) {
params.put("page", "1");//如果是查询分页重置为第一页
queryWrapper.like("username", key).or().like("mobile", key);
queryWrapper.like("username", key)
.or()
.like("mobile", key);
}
queryWrapper.lambda().orderByDesc(AppUserEntity::getUid);
IPage<AppUserEntity> page = this.page(

View File

@ -63,14 +63,13 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
//条件查询
String key = (String)params.get("key");
String status = (String)params.get("status");
if(!ObjectUtil.isEmpty(key)){
params.put("page","1");//如果是查询分页重置为第一页
queryWrapper.like("content", key).or().like("title",key);
}
if(!ObjectUtil.isEmpty(status)){
params.put("page","1");//如果是查询分页重置为第一页
queryWrapper.eq("status", Integer.parseInt(status));
}
// if(!ObjectUtil.isEmpty(key)){
// queryWrapper.like("content", key).or().like("title",key);
// }
queryWrapper
.like(!ObjectUtil.isEmpty(status),"content", key)
.or()
.like(!ObjectUtil.isEmpty(status),"title",key);
queryWrapper.lambda().orderByDesc(PostEntity::getId);
IPage<PostEntity> page = this.page(
new Query<PostEntity>().getPage(params),