Commit ced9f2d9 authored by 杨翌文's avatar 杨翌文

修改帖子列表页的评论数为3

parent f8dc1f5a
......@@ -145,7 +145,7 @@ exports.getThreadById = function(tid, callback) {
level: '1'
// status:1
};
//获取最新10条评论
//获取最新10条评论
forumCommentService.getAllComment(conditions, 1, 10, function(err, results) {
if (err) {
console.log(err);
......@@ -178,7 +178,7 @@ exports.getThreadById = function(tid, callback) {
pid: tid,
type: 3,
status:1,
images: {$exists: true, $not: {$size: 0}}
images: {$exists: true, $not: {$size: 0}}
};
getAllThreadByFidHelp(conditions, 1, 10, '-created', function(err, threads) {
if (err) {
......@@ -195,7 +195,7 @@ exports.getThreadById = function(tid, callback) {
pid: tid,
type: 3,
status:1,
images: {$exists: true, $not: {$size: 0}}
images: {$exists: true, $not: {$size: 0}}
};
getAllThreadByFidHelp(conditions, 1, 10, '-praise_count', function(err, threads) {
if (err) {
......@@ -273,7 +273,7 @@ exports.getThreadByIdNoLimit = function(tid, callback) {
level: '1'
// status:1
};
//获取最新10条评论
//获取最新10条评论
forumCommentService.getAllComment(conditions, 1, 999, function(err, results) {
if (err) {
console.log(err);
......@@ -306,7 +306,7 @@ exports.getThreadByIdNoLimit = function(tid, callback) {
pid: tid,
type: 3,
status:1,
images: {$exists: true, $not: {$size: 0}}
images: {$exists: true, $not: {$size: 0}}
};
getAllThreadByFidHelp(conditions, 1, 10, '-created', function(err, threads) {
if (err) {
......@@ -323,7 +323,7 @@ exports.getThreadByIdNoLimit = function(tid, callback) {
pid: tid,
type: 3,
status:1,
images: {$exists: true, $not: {$size: 0}}
images: {$exists: true, $not: {$size: 0}}
};
getAllThreadByFidHelp(conditions, 1, 10, '-praise_count', function(err, threads) {
if (err) {
......@@ -632,7 +632,7 @@ function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) {
path: 'comments',
options: {
where:{status:1},
limit: 5,
limit: 3,
sort: '-created'
},
select: 'from to created content level'
......@@ -910,7 +910,7 @@ exports.updateThreadCommentCountInc = function(threadId, callback) {
});
};
//更新文章评论数
//更新文章评论数
exports.updateThreadCommentCount = function(threadId, callback) {
ForumThread.update({
_id: threadId
......@@ -995,7 +995,7 @@ function getAllThreadByFidHelpAndNickName(user_ids, conditions, pageNo, pageSize
path: 'comments',
options: {
where:{status:1},
limit: 5,
limit: 3,
sort: '-created'
},
select: 'from to created content'
......@@ -1031,6 +1031,6 @@ exports.getAllThreadByFidAndNickName = function(nickName, conditions, pageNo, pa
}
getAllThreadByFidHelpAndNickName(user_ids, conditions, pageNo, pageSize, sort, callback);
}
});
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment