Commit fcb4a018 authored by strong's avatar strong

Merge commit 'b297a896' into SANDBOX

parents 3ed356ae b297a896
...@@ -654,15 +654,9 @@ router.get('/thread/:tid/comment/list', function(req, res, next) { ...@@ -654,15 +654,9 @@ router.get('/thread/:tid/comment/list', function(req, res, next) {
comment.floor = p_comment.floor; comment.floor = p_comment.floor;
cb(null, comment); cb(null, comment);
} else if(p_comment && !p_comment.floor){ //上一级没有楼层就再查上一级的评论 } else if(p_comment && !p_comment.floor){ //上一级没有楼层就再查上一级的评论
forumCommentService.getCommentParent(new mongoose.Types.ObjectId(p_comment._id), function(err, p_p_comment) { var comment = e.toObject();
if(p_comment){ comment.floor = comment.oneCommentFloor;
var comment = e.toObject(); cb(null, comment);
comment.floor = p_p_comment.floor;
cb(null, comment);
}else{
cb(null, e);
}
});
}else{ }else{
cb(null, e); cb(null, e);
} }
...@@ -1020,7 +1014,6 @@ router.post('/thread/comment/add', function(req, res, next) { ...@@ -1020,7 +1014,6 @@ router.post('/thread/comment/add', function(req, res, next) {
if (err) { if (err) {
callback(err); callback(err);
} else { } else {
forumThreadService.getById(tid, function(err, thread) { forumThreadService.getById(tid, function(err, thread) {
if (entity.level == 1) { if (entity.level == 1) {
forumAboutMEService.saveCommentLevel1(thread, comment); forumAboutMEService.saveCommentLevel1(thread, comment);
......
...@@ -63,6 +63,10 @@ var ForumCommentSchema = new Schema({ ...@@ -63,6 +63,10 @@ var ForumCommentSchema = new Schema({
floor: { //评论楼层 floor: { //评论楼层
type: Number, type: Number,
require: false require: false
},
oneCommentFloor:{ //一级评论楼层
type: Number,
require: false
} }
}, { }, {
'collection': 'pisns_forum_comment' 'collection': 'pisns_forum_comment'
......
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