Commit e76aa5ae authored by 邓军's avatar 邓军

qq

parent 4b434c33
...@@ -120,13 +120,17 @@ router.get('/thread/:tid/get', function(req, res, next) { ...@@ -120,13 +120,17 @@ router.get('/thread/:tid/get', function(req, res, next) {
//更新文章状态、如:屏蔽 //更新文章状态、如:屏蔽
router.post('/thread/:tid/update', function(req, res, next) { router.post('/thread/:tid/update', function(req, res, next) {
var tid=req.params.tid; var tid=req.params.tid;
var fatherTitle = req.body.father;
delete req.body.father;
req.body.ent_code=req.session.user.ent_code; req.body.ent_code=req.session.user.ent_code;
if(tid){ if(tid){
forumThreadService.updateThreadById(tid,req.body,function(err,thread){ forumThreadService.updateThreadById(tid,req.body,function(err,thread){
if(err){ if(err){
res.json(returnCode.BUSY); res.json(returnCode.BUSY);
}else{ }else{
res.json(returnCode.SUCCESS); console.log(thread);
console.log(fatherTitle);
res.json({message:"success",data:thread,title:fatherTitle});
} }
}); });
}else{ }else{
...@@ -196,6 +200,7 @@ router.get('/threads/list', function(req, res, next) { ...@@ -196,6 +200,7 @@ router.get('/threads/list', function(req, res, next) {
var pageSize = req.query.pageSize || 10; var pageSize = req.query.pageSize || 10;
var infoId=req.query.infoId; var infoId=req.query.infoId;
var tagId=req.query.tagId; var tagId=req.query.tagId;
var pid=req.query.pid;
var conditions={ var conditions={
ent_code:req.session.user.ent_code, ent_code:req.session.user.ent_code,
level:1 level:1
...@@ -206,6 +211,13 @@ router.get('/threads/list', function(req, res, next) { ...@@ -206,6 +211,13 @@ router.get('/threads/list', function(req, res, next) {
if(tagId){ if(tagId){
conditions.tag={$in:[tagId]}; conditions.tag={$in:[tagId]};
} }
if(pid){
conditions.pid = pid;
conditions.level = 2;
}
console.log(conditions);
forumThreadService.getAllThreadByFid(conditions,pageNo,pageSize,null,function(err,results){ forumThreadService.getAllThreadByFid(conditions,pageNo,pageSize,null,function(err,results){
if(err){ if(err){
console.error(err); console.error(err);
......
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