Commit 8dec21ca authored by strong's avatar strong

Merge branch '0911_AboutMe'

parents bb60401f aa90cae6
...@@ -557,10 +557,14 @@ router.post('/thread/:tid/comment/add', function(req, res, next) { ...@@ -557,10 +557,14 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if (err) { if (err) {
callback(err, null); callback(err, null);
} else { } else {
if(user.getMobileUser(req) !== thread.from){//文章的作者不等于评论的作者才增加消息数 try{
commentTips.incrTips(req.session.user.ent_code,thread.from._id); if(user.getMobileUser(req).toString() != thread.from._id.toString()){//文章的作者不等于评论的作者才增加消息数
forumThreadAttendService.threadAttend(thread._id,user.getMobileUser(req),function(err){}); commentTips.incrTips(req.session.user.ent_code,thread.from._id);
} forumThreadAttendService.threadAttend(thread._id,user.getMobileUser(req),function(err){});
}
}catch(e){
console.log(e);
}
forumAboutMEService.saveCommentLevel1(thread,newComment); forumAboutMEService.saveCommentLevel1(thread,newComment);
var comments = thread.comments; var comments = thread.comments;
var array = []; var array = [];
...@@ -700,15 +704,17 @@ router.post('/thread/:tid/comment/create', function(req, res, next) { ...@@ -700,15 +704,17 @@ router.post('/thread/:tid/comment/create', function(req, res, next) {
if (err) { if (err) {
callback(err, null); callback(err, null);
} else { } else {
if(user.getMobileUser(req) !== thread.from){//文章的作者不等于评论的作者才增加消息数 try{
commentTips.incrTips(req.session.user.ent_code,thread.from._id); if(user.getMobileUser(req).toString() != thread.from._id.toString()){//文章的作者不等于评论的作者才增加消息数
forumThreadAttendService.threadAttend(thread._id,user.getMobileUser(req),function(err){}); commentTips.incrTips(req.session.user.ent_code,thread.from._id);
} forumThreadAttendService.threadAttend(thread._id,user.getMobileUser(req),function(err){});
}
}catch(e){
console.log(e);
}
forumAboutMEService.saveCommentLevel1(thread,newComment); forumAboutMEService.saveCommentLevel1(thread,newComment);
var comments = thread.comments; var comments = thread.comments;
// console.log('=========');
// console.log(comments);
// console.log('=========');
var array = []; var array = [];
if (comments && comments.items && comments.items.length > 0) { if (comments && comments.items && comments.items.length > 0) {
array = comments.items; array = comments.items;
...@@ -863,10 +869,14 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) { ...@@ -863,10 +869,14 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
if (err) { if (err) {
callback(err, null); callback(err, null);
} else { } else {
if(user.getMobileUser(req) !== req.body.to){//被评论人 和评论人不是同一个 try{
commentTips.incrTips(req.session.user.ent_code,req.body.to); if(user.getMobileUser(req).toString() != req.body.to.toString()){//被评论人 和评论人不是同一个
forumThreadAttendService.threadAttend(tid,user.getMobileUser(req),function(err){}); commentTips.incrTips(req.session.user.ent_code,req.body.to);
} forumThreadAttendService.threadAttend(tid,user.getMobileUser(req),function(err){});
}
}catch(e){
console.log(e);
}
forumAboutMEService.saveCommentLevel2(tid,comment,newComment); forumAboutMEService.saveCommentLevel2(tid,comment,newComment);
var comments = comment.comments; var comments = comment.comments;
var array = []; var array = [];
......
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