Commit 6b8aa6c8 authored by 陈家荣's avatar 陈家荣

11

parent 53870e71
...@@ -429,13 +429,18 @@ router.post('/thread/:tid/comment/create', function(req, res, next) { ...@@ -429,13 +429,18 @@ router.post('/thread/:tid/comment/create', function(req, res, next) {
} else { } else {
async.parallel([ async.parallel([
function(callback) { function(callback) {
var floor = 1;
if(thread.comments){
floor = thread.comments.length + 1;
}
var entity = { var entity = {
ent_code: req.session.user.ent_code, ent_code: req.session.user.ent_code,
from: user.getMobileUser(req), from: user.getMobileUser(req),
content: content, content: content,
ip: req.ip, ip: req.ip,
thread: thread, thread: thread,
level: '1' level: '1',
floor: floor
}; };
//4.创建文章评论 //4.创建文章评论
forumCommentService.createComment(entity, function(err, newComment) { forumCommentService.createComment(entity, function(err, newComment) {
...@@ -1013,3 +1018,5 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) { ...@@ -1013,3 +1018,5 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) {
res.json(returnCode.WRONG_PARAM); res.json(returnCode.WRONG_PARAM);
} }
}); });
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