修复了startPage方法中,只设置排序参数,排序不生效的问题。

不设置pageNum,pageSize参数时,排序参数会被过滤掉不生效。
This commit is contained in:
dexin xu@macbook 2021-03-24 08:38:59 +08:00
parent 457ec516f7
commit 83fa1900ad
1 changed files with 3 additions and 0 deletions

View File

@ -56,6 +56,9 @@ public class BaseController
{ {
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper.startPage(pageNum, pageSize, orderBy); PageHelper.startPage(pageNum, pageSize, orderBy);
}else {
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper.orderBy(orderBy);
} }
} }