Commit 2f157241 authored by 刘文胜's avatar 刘文胜

批量 逻辑删除/屏蔽帖子

parent 9120e07a
......@@ -376,4 +376,34 @@ router.get('/threadManagement/threads/statistics', function(req, res, next) {
}, returnCode.SUCCESS));
});
});
\ No newline at end of file
});
//批量屏蔽帖子
router.post('/threadManagement/threads/batchclose', function(req, res, next) {
var ent_code = req.session.user.ent_code;
var ids = req.body.ids;
if(!ent_code || !ids){
return res.json(returnCode.BUSY);
}
forumThreadService.batchClose(ent_code,ids,function(err,result){
if(err){
return res.json(returnCode.BUSY);
}
return res.json(_.assign({data:true}, returnCode.SUCCESS));
});
});
//批量删除帖子
router.post('/threadManagement/threads/batchdel', function(req, res, next) {
var ent_code = req.session.user.ent_code;
var ids = req.body.ids;
if(!ent_code || !ids){
return res.json(returnCode.BUSY);
}
forumThreadService.batchLogicDelete(ent_code,ids,function(err,result){
if(err){
return res.json(returnCode.BUSY);
}
return res.json(_.assign({data:true}, returnCode.SUCCESS));
});
});
......@@ -1140,6 +1140,19 @@ exports.updateThreadRaiseCount = function(threadId, callback) {
});
};
//批量屏蔽帖子
exports.batchClose = function(ent_code,ids, callback) {
update({ent_code:ent_code,_id: {$in:ids}}, {$set:{status:0}}, { multi: true }, 'updateRedisRecommentThreads',function(err, result) {
callback(err, !!!err);
});
};
//批量删除
exports.batchLogicDelete = function(ent_code,ids, callback) {
update({ent_code:ent_code,_id: {$in:ids}}, {$set:{status:3}}, { multi: true }, 'updateRedisRecommentThreads',function(err, result) {
callback(err, !!!err);
});
};
//减少文章点赞数
exports.updateThreadRaiseCountDec = function(threadId, callback) {
// ForumThread.update({
......
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