Authored by OF1706

guang comment

... ... @@ -215,7 +215,7 @@ exports.detail = (req, res, next) => {
}
if (pjax) {
req.ctx(guangModel).getArticleComments(id, page, pageSize).then(ret => {
req.ctx(guangModel).getArticleComments(uid, id, page, pageSize).then(ret => {
res.set('Cache-Control', 'no-cache');
res.render('guang/detail-comment', {
... ... @@ -248,7 +248,7 @@ exports.detail = (req, res, next) => {
headerModel.requestHeaderData(channel),
reqCtx.getArticleContent(id),
reqCtx.getHotTags(1, 20, channel, isHotDegrade),
reqCtx.getArticleComments(id, page, pageSize),
reqCtx.getArticleComments(uid, id, page, pageSize),
reqCtx.getArticleBaseInfo(id, uid, udid),
reqCtx.getArticleRelateBrand(id),
reqCtx.getRecoArticles(gender, 1, 10, channel),
... ... @@ -390,7 +390,7 @@ exports.comment = (req, res) => {
req.session['comment_' + udid] = null;
}
return req.ctx(guangModel).getArticleComments(id, 1, 20);
return req.ctx(guangModel).getArticleComments(uid, id, 1, 20);
}).then(commentInfo => {
res.render('guang/detail-comment', {
... ...
... ... @@ -918,11 +918,14 @@ module.exports = class extends global.yoho.BaseModel {
/**
* 获取文章评论数据
*/
getArticleComments(aid, page, pageSize) {
getArticleComments(uid, aid, page, pageSize) {
uid = uid || 0;
page = page || 1;
pageSize = pageSize || 20;
let data = {
uid: uid,
article_id: aid,
page: page,
limit: pageSize
... ...