Commit 06980bc0 authored by 陈志良's avatar 陈志良

1

parent 6f2f683b
...@@ -193,7 +193,8 @@ router.get('/info/:fid/hotThreads', function(req, res, next) { ...@@ -193,7 +193,8 @@ router.get('/info/:fid/hotThreads', function(req, res, next) {
var conditions = { var conditions = {
ent_code: req.session.user.ent_code, ent_code: req.session.user.ent_code,
level: 1, level: 1,
info: fid info: fid,
status:{$ne:3}
}; };
if (fid) { if (fid) {
...@@ -247,7 +248,8 @@ router.get('/info/:fid/photoThreads', function(req, res, next) { ...@@ -247,7 +248,8 @@ router.get('/info/:fid/photoThreads', function(req, res, next) {
ent_code: req.session.user.ent_code, ent_code: req.session.user.ent_code,
level: 1, level: 1,
info: fid, info: fid,
type: 3 type: 3,
status:{$ne:3}
}; };
if (fid) { if (fid) {
......
...@@ -661,6 +661,34 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) { ...@@ -661,6 +661,34 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
} }
}); });
//更改评论状态为3(删除)
router.post('/thread/:tid/comment/:cid/disable', 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,2,function(err,update){
if (err) {
res.json(returnCode.BUSY);
} else {
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) { router.post('/thread/:tid/comment/:cid/delete', function(req, res, next) {
var tid = req.params.tid || null; var tid = req.params.tid || null;
...@@ -885,7 +913,8 @@ router.get('/thread/:tid/topics', function(req, res, next) { ...@@ -885,7 +913,8 @@ router.get('/thread/:tid/topics', function(req, res, next) {
var conditions = { var conditions = {
ent_code: req.session.user.ent_code, ent_code: req.session.user.ent_code,
pid: tid, pid: tid,
type: 2 type: 2,
status:{$ne:3}
}; };
if (tid) { if (tid) {
...@@ -940,6 +969,7 @@ router.get('/thread/:tid/latestPhotos', function(req, res, next) { ...@@ -940,6 +969,7 @@ router.get('/thread/:tid/latestPhotos', function(req, res, next) {
ent_code: req.session.user.ent_code, ent_code: req.session.user.ent_code,
pid: tid, pid: tid,
type: 3, type: 3,
status:{$ne:3},
images: {$exists: true, $not: {$size: 0}} images: {$exists: true, $not: {$size: 0}}
}; };
...@@ -994,6 +1024,7 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) { ...@@ -994,6 +1024,7 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) {
ent_code: req.session.user.ent_code, ent_code: req.session.user.ent_code,
pid: tid, pid: tid,
type: 3, type: 3,
status:{$ne:3},
images: {$exists: true, $not: {$size: 0}} images: {$exists: true, $not: {$size: 0}}
}; };
...@@ -1040,13 +1071,13 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) { ...@@ -1040,13 +1071,13 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) {
//逻辑删除文章 //逻辑删除文章
router.post('/thread/:tid/logicDeleteThread', function(req, res, next) { router.post('/thread/:tid/disable', function(req, res, next) {
var user_id = user.getMobileUser(req); var user_id = user.getMobileUser(req);
var tid = req.params.tid; var tid = req.params.tid;
if (tid) { if (tid) {
forumThreadService.getThreadById(tid,function(err,thread){ forumThreadService.getThreadById(tid,function(err,thread){
if(thread.from && user_id){ if(thread.from && user_id){
if(thread.from.toString() == user_id.toString()){ if(thread.from._id.toString() == user_id.toString()){
forumThreadService.logicDeleteThreadById(tid, function(err, flag) { forumThreadService.logicDeleteThreadById(tid, function(err, flag) {
if (err) { if (err) {
res.json(returnCode.BUSY); res.json(returnCode.BUSY);
......
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