|
|
@ -85,8 +85,8 @@ app.get('/article/:id', async (req, res) => { |
|
|
|
article.content = await syzoj.utils.markdown(article.content); |
|
|
|
article.content = await syzoj.utils.markdown(article.content); |
|
|
|
|
|
|
|
|
|
|
|
let where = { article_id: id }; |
|
|
|
let where = { article_id: id }; |
|
|
|
|
|
|
|
let commentsCount = await ArticleComment.count(where); |
|
|
|
let paginate = syzoj.utils.paginate(await ArticleComment.count(where), req.query.page, syzoj.config.page.article_comment); |
|
|
|
let paginate = syzoj.utils.paginate(commentsCount, req.query.page, syzoj.config.page.article_comment); |
|
|
|
|
|
|
|
|
|
|
|
let comments = await ArticleComment.query(paginate, where, [['public_time', 'desc']]); |
|
|
|
let comments = await ArticleComment.query(paginate, where, [['public_time', 'desc']]); |
|
|
|
|
|
|
|
|
|
|
@ -108,7 +108,8 @@ app.get('/article/:id', async (req, res) => { |
|
|
|
article: article, |
|
|
|
article: article, |
|
|
|
comments: comments, |
|
|
|
comments: comments, |
|
|
|
paginate: paginate, |
|
|
|
paginate: paginate, |
|
|
|
problem: problem |
|
|
|
problem: problem, |
|
|
|
|
|
|
|
commentsCount: commentsCount |
|
|
|
}); |
|
|
|
}); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
syzoj.log(e); |
|
|
|
syzoj.log(e); |
|
|
|