|
|
@@ -94,14 +94,20 @@ public class MesProductQmService extends CrudService<MesProductQmDao, MesProduct
|
|
|
if (page == null) {
|
|
|
page = new Page<>();
|
|
|
}
|
|
|
- mesProductQm.setPage(page);
|
|
|
|
|
|
int pageNo = page.getPageNo() < 1 ? 1 : page.getPageNo();
|
|
|
int pageSize = page.getPageSize() < 1 ? 20 : page.getPageSize();
|
|
|
page.setPageNo(pageNo);
|
|
|
page.setPageSize(pageSize);
|
|
|
|
|
|
- long count = mesProductQmDao.findLatestCount(mesProductQm);
|
|
|
+ // 总数查询只返回一行,不能让 JeeSite 对它追加当前页的偏移量。
|
|
|
+ mesProductQm.setPage(null);
|
|
|
+ long count;
|
|
|
+ try {
|
|
|
+ count = mesProductQmDao.findLatestCount(mesProductQm);
|
|
|
+ } finally {
|
|
|
+ mesProductQm.setPage(page);
|
|
|
+ }
|
|
|
page.setCount(count);
|
|
|
|
|
|
int offset = (pageNo - 1) * pageSize;
|