后台管理条件查询bug修复
This commit is contained in:
parent
c70fdd64d4
commit
d7b8723479
@ -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(
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user