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

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

parent f8dc1f5a
...@@ -145,7 +145,7 @@ exports.getThreadById = function(tid, callback) { ...@@ -145,7 +145,7 @@ exports.getThreadById = function(tid, callback) {
level: '1' level: '1'
// status:1 // status:1
}; };
//获取最新10条评论 //获取最新10条评论
forumCommentService.getAllComment(conditions, 1, 10, function(err, results) { forumCommentService.getAllComment(conditions, 1, 10, function(err, results) {
if (err) { if (err) {
console.log(err); console.log(err);
...@@ -178,7 +178,7 @@ exports.getThreadById = function(tid, callback) { ...@@ -178,7 +178,7 @@ exports.getThreadById = function(tid, callback) {
pid: tid, pid: tid,
type: 3, type: 3,
status:1, status:1,
images: {$exists: true, $not: {$size: 0}} images: {$exists: true, $not: {$size: 0}}
}; };
getAllThreadByFidHelp(conditions, 1, 10, '-created', function(err, threads) { getAllThreadByFidHelp(conditions, 1, 10, '-created', function(err, threads) {
if (err) { if (err) {
...@@ -195,7 +195,7 @@ exports.getThreadById = function(tid, callback) { ...@@ -195,7 +195,7 @@ exports.getThreadById = function(tid, callback) {
pid: tid, pid: tid,
type: 3, type: 3,
status:1, status:1,
images: {$exists: true, $not: {$size: 0}} images: {$exists: true, $not: {$size: 0}}
}; };
getAllThreadByFidHelp(conditions, 1, 10, '-praise_count', function(err, threads) { getAllThreadByFidHelp(conditions, 1, 10, '-praise_count', function(err, threads) {
if (err) { if (err) {
...@@ -273,7 +273,7 @@ exports.getThreadByIdNoLimit = function(tid, callback) { ...@@ -273,7 +273,7 @@ exports.getThreadByIdNoLimit = function(tid, callback) {
level: '1' level: '1'
// status:1 // status:1
}; };
//获取最新10条评论 //获取最新10条评论
forumCommentService.getAllComment(conditions, 1, 999, function(err, results) { forumCommentService.getAllComment(conditions, 1, 999, function(err, results) {
if (err) { if (err) {
console.log(err); console.log(err);
...@@ -306,7 +306,7 @@ exports.getThreadByIdNoLimit = function(tid, callback) { ...@@ -306,7 +306,7 @@ exports.getThreadByIdNoLimit = function(tid, callback) {
pid: tid, pid: tid,
type: 3, type: 3,
status:1, status:1,
images: {$exists: true, $not: {$size: 0}} images: {$exists: true, $not: {$size: 0}}
}; };
getAllThreadByFidHelp(conditions, 1, 10, '-created', function(err, threads) { getAllThreadByFidHelp(conditions, 1, 10, '-created', function(err, threads) {
if (err) { if (err) {
...@@ -323,7 +323,7 @@ exports.getThreadByIdNoLimit = function(tid, callback) { ...@@ -323,7 +323,7 @@ exports.getThreadByIdNoLimit = function(tid, callback) {
pid: tid, pid: tid,
type: 3, type: 3,
status:1, status:1,
images: {$exists: true, $not: {$size: 0}} images: {$exists: true, $not: {$size: 0}}
}; };
getAllThreadByFidHelp(conditions, 1, 10, '-praise_count', function(err, threads) { getAllThreadByFidHelp(conditions, 1, 10, '-praise_count', function(err, threads) {
if (err) { if (err) {
...@@ -632,7 +632,7 @@ function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) { ...@@ -632,7 +632,7 @@ function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) {
path: 'comments', path: 'comments',
options: { options: {
where:{status:1}, where:{status:1},
limit: 5, limit: 3,
sort: '-created' sort: '-created'
}, },
select: 'from to created content level' select: 'from to created content level'
...@@ -910,7 +910,7 @@ exports.updateThreadCommentCountInc = function(threadId, callback) { ...@@ -910,7 +910,7 @@ exports.updateThreadCommentCountInc = function(threadId, callback) {
}); });
}; };
//更新文章评论数 //更新文章评论数
exports.updateThreadCommentCount = function(threadId, callback) { exports.updateThreadCommentCount = function(threadId, callback) {
ForumThread.update({ ForumThread.update({
_id: threadId _id: threadId
...@@ -995,7 +995,7 @@ function getAllThreadByFidHelpAndNickName(user_ids, conditions, pageNo, pageSize ...@@ -995,7 +995,7 @@ function getAllThreadByFidHelpAndNickName(user_ids, conditions, pageNo, pageSize
path: 'comments', path: 'comments',
options: { options: {
where:{status:1}, where:{status:1},
limit: 5, limit: 3,
sort: '-created' sort: '-created'
}, },
select: 'from to created content' select: 'from to created content'
...@@ -1031,6 +1031,6 @@ exports.getAllThreadByFidAndNickName = function(nickName, conditions, pageNo, pa ...@@ -1031,6 +1031,6 @@ exports.getAllThreadByFidAndNickName = function(nickName, conditions, pageNo, pa
} }
getAllThreadByFidHelpAndNickName(user_ids, conditions, pageNo, pageSize, sort, callback); 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