Authored by yyq

Merge branch 'feature/spread' into release/5.9

... ... @@ -9,7 +9,7 @@ const spreadModel = require('../models/spread');
exports.index = (req, res, next) => {
req.ctx(spreadModel).getIndexData(req.user.uid).then(result => {
req.ctx(spreadModel).getIndexData(req.user.uid, req.query.page).then(result => {
res.render('spread', {
page: 'spread',
spread: result
... ...
... ... @@ -35,7 +35,17 @@ module.exports = class extends global.yoho.BaseModel {
resData.list = list;
}
Object.assign(resData, setPager(_.get(resList, 'data.total', 1), {page: page}));
let totalPage = _.get(resList, 'data.pageSize', 1);
if (+totalPage > 1) {
resData.pager = setPager(totalPage, {page: page});
Object.assign(resData.pager, {
count: _.get(resList, 'data.total', 0),
curPage: _.get(resList, 'data.currPage', 1),
totalPages: totalPage
})
}
}
return resData;
... ...