Authored by jinhu.tung

pagination totalRows params to total

... ... @@ -35,7 +35,7 @@ const index = (req, res) => {
paginationOpts: {
page: pageNum, // current page: http://host/?page=2
limit: 10, // per_page records' number
totalRows: 100 // total page number
total: 100 // total page number
},
goods: {
img: 'http://placehold.it/274x366',
... ...
... ... @@ -27,7 +27,7 @@
paginationOpts: {
page: page, // 当前页 http://host/?page=2
limit: 10, // 每页显示多少
totalRows: 100 // 一共多少纪录
total: 100 // 一共多少纪录
}
});
... ...
... ... @@ -33,7 +33,7 @@ exports.createPagination = function(pagination, options) {
queryParams = '', // paginate with query parameter
page = parseInt(pagination.page, 10), // current page number
leftText = '<i class="iconfont">&#xe607;</i>', // prev
rightText = '<i class="iconfont">&#xe61e;</i>', // next
rightText = '<i class="iconfont">&#xe606;</i>', // next
paginationClass = 'blk-pagination'; // pagination <ul> default class
var pageCount,
... ... @@ -68,7 +68,7 @@ exports.createPagination = function(pagination, options) {
paginationClass = options.hash.paginationClass;
}
pageCount = Math.ceil(pagination.totalRows / pagination.limit);
pageCount = Math.ceil(pagination.total / pagination.limit);
// query params
if (pagination.queryParams) {
... ...