Commit eab1ae5a authored by strong's avatar strong

Merge commit 'e3bfbbfd' into SANDBOX

parents f21b49f4 e3bfbbfd
......@@ -496,9 +496,9 @@ router.get('/thread/:tid/comment/list', function(req, res, next) {
ent_code: req.session.user.ent_code,
thread: tid,
// level: '1',
// status: {
// $ne: 2
// } //过滤被删除的数据,status 为 2 表示删除
status: {
$ne: 2
} //过滤被删除的数据,status 为 2 表示删除
};
if (content) {
conditions.content = {
......@@ -547,7 +547,10 @@ router.get('/thread/:tid/comment/list/:floor', function(req, res, next) {
ent_code: req.session.user.ent_code,
thread: tid,
level: '1',
floor: floor
floor: floor,
status: {
$ne: 2
} //过滤被删除的数据,status 为 2 表示删除
};
if (tid && floor) {
......@@ -592,7 +595,10 @@ router.get('/thread/:tid/comment/list/member/:mid', function(req, res, next) {
pageSize = req.query.pageSize || 10;
var conditions = {
ent_code: req.session.user.ent_code,
thread: tid
thread: tid,
status: {
$ne: 2
} //过滤被删除的数据,status 为 2 表示删除
};
if (content) {
conditions.content = {
......@@ -721,7 +727,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
if (status == 2) {
//一级评论
if (comment.level == 1) {
var commentList = result.comments;
var commentList = comment.comments;
var comments = forumThreadService.remove(commentList, cid);
forumThreadService.updateThreadById(comment.thread, {
comments: comments,
......
......@@ -1709,6 +1709,40 @@ router.post('/thread/:tid/comment/:cid/disable', function(req, res, next) {
}
});
//更改评论状态为0(屏蔽)
router.post('/thread/:tid/comment/:cid/slash', function(req, res, next) {
var user_id = user.getMobileUser(req),
tid = req.params.tid,
cid = req.params.cid;
if (tid && cid) {
forumCommentService.getCommentById(cid, function(err, comment) {
if (comment && user_id) {
if (comment.from.toString() == user_id.toString()) {
forumCommentService.changeStatus(cid, 0, function(err, update) {
if (err) {
res.json(returnCode.BUSY);
} else {
if (comment && comment.level == 1) {
forumAboutMEService.updateCommentLevel1Status(comment._id, 0);
}
// if (comment && comment.level == 2) {
// forumAboutMEService.updateCommentLevel2Status(comment._id, 2);
// }
res.json(returnCode.SUCCESS);
}
});
} else {
res.json(returnCode.ACTION_NOT_PERMISSION);
}
} else {
res.json(returnCode.WRONG_PARAM);
}
});
} else {
res.json(returnCode.WRONG_PARAM);
}
});
//删除文章评论
router.post('/thread/:tid/comment/:cid/delete', function(req, res, next) {
var tid = req.params.tid || null;
......
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