Commit a32fda54 authored by 陈家荣's avatar 陈家荣

更新后台回复评论时评论数不对BUG

parent 8d924e48
......@@ -650,9 +650,13 @@ router.get('/thread/:tid/comment/list', function(req, res, next) {
cb(null, e);
} else {
forumCommentService.getCommentParent(e._id, function(err, p_comment) {
if(p_comment){
var comment = e.toObject();
comment.floor = p_comment.floor;
cb(null, comment);
}else{
cb(null, e);
}
});
}
});
......@@ -920,11 +924,11 @@ router.post('/thread/comment/update/:cid/comments', function(req, res, next) {
// 获取评论的子评论列表
// 更新文章评论 + 1
forumThreadService.updateThreadCommentCountInc(tid, function(err, thread) {
if (err) {
console.error(err);
}
});
// forumThreadService.updateThreadCommentCountInc(tid, function(err, thread) {
// if (err) {
// console.error(err);
// }
// });
// 更新评论对象
// result.comment_count+=1; // 回复评论+1
forumCommentService.updateCommentById(cid, {
......
......@@ -694,7 +694,7 @@ router.post('/thread/:tid/delete', function(req, res, next) {
//文章点赞和取消点赞
router.post('/thread/:tid/praiseOrCancelPraise', function(req, res, next) {
var userId = req.session.mobileForumUser.userId;
var userId = user.getMobileUser(req);
var mid = req.session.openUser.mid;
var tid = req.params.tid || null;
var ent_code = req.session.user.ent_code;
......
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