Commit c07708d1 authored by 刘文胜's avatar 刘文胜

111111

parent 55d36ef2
...@@ -224,6 +224,17 @@ router.get('/infos/list', function(req, res, next) { ...@@ -224,6 +224,17 @@ router.get('/infos/list', function(req, res, next) {
}); });
}); });
//直接修改序号
router.put('/infos/orderIDX/:id/:order', function(req, res, next) {
var id=req.params.id;
var idx=req.params.order;
forumInfoService.updateInfoIdx(id,idx,function(err,result){
if(err || !result){
return res.json(returnCode.BUSY);
}
return res.json(_.assign({data:true}, returnCode.SUCCESS));
});
});
//板块上移 //板块上移
router.put('/infos/moveUP/:id/:order', function(req, res, next) { router.put('/infos/moveUP/:id/:order', function(req, res, next) {
var id=req.params.id; var id=req.params.id;
......
...@@ -73,6 +73,14 @@ function queryList(condition,sort,pageNo,pageSize,callback){ ...@@ -73,6 +73,14 @@ function queryList(condition,sort,pageNo,pageSize,callback){
if(err){ if(err){
return callback && callback({err:err}); return callback && callback({err:err});
} }
_.forEach(results,function(o,i){
if(o.populated('plate') && !o.plate){//对应的板块不存在
results[i] = o.toObject();
results[i].plate={
deleted:true
};
}
});
return callback && callback(false,{data:results,total:count}); return callback && callback(false,{data:results,total:count});
}); });
}) })
...@@ -197,6 +205,19 @@ router.post('/notice/search', function(req, res, next) { ...@@ -197,6 +205,19 @@ router.post('/notice/search', function(req, res, next) {
}); });
}); });
//直接修改序号
router.put('/notice/orderIDX/:id/:order', function(req, res, next) {
var id=req.params.id;
var idx=req.params.order;
updateNoticIdx(id,idx,function(err,result){
if(err || !result){
console.log(err);
return res.json(returnCode.BUSY);
}
return res.json(_.assign({data:true}, returnCode.SUCCESS));
});
});
//上移 //上移
router.put('/notice/moveUP/:id/:order', function(req, res, next) { router.put('/notice/moveUP/:id/:order', function(req, res, next) {
var id=req.params.id; var id=req.params.id;
......
...@@ -95,6 +95,18 @@ router.get('/tag/:tid/get', function(req, res, next) { ...@@ -95,6 +95,18 @@ router.get('/tag/:tid/get', function(req, res, next) {
} }
}); });
//直接修改序号
router.put('/tag/orderIDX/:id/:order', function(req, res, next) {
var id=req.params.id;
var idx=req.params.order;
forumTagService.updateTagIdx(id,idx,function(err,result){
if(err || !result){
return res.json(returnCode.BUSY);
}
return res.json(_.assign({data:true}, returnCode.SUCCESS));
});
});
//上移 //上移
router.put('/tag/moveUP/:id/:order', function(req, res, next) { router.put('/tag/moveUP/:id/:order', function(req, res, next) {
var id=req.params.id; var id=req.params.id;
......
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