Commit 81be1a3b authored by 刘文胜's avatar 刘文胜

1111

parent 656e7786
......@@ -189,8 +189,8 @@ router.post('/notice/search', function(req, res, next) {
}
queryList(_condition,_sort,pageNo,pageSize,function(err,result){
console.log(err);
if(err){
console.log(err);
return res.json(err);
}
return res.json(result);
......@@ -268,6 +268,7 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
getAllOrderIDX(_condition,_sort,function(err,results){
if(err){
console.log(err);
return res.json(returnCode.BUSY);
}
var index=-1;
......@@ -277,10 +278,12 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
}
});
if(index === -1){
console.log('没有找到对应项');
return res.json(returnCode.BUSY);
}
var preObj=results[index-1];
if(!preObj){
console.log('已经是第一个了');
return res.json(returnCode.BUSY);
}
var preidx=preObj.order_idx;
......@@ -289,10 +292,12 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
}
updateNoticIdx(id,preidx,function(err,result){
if(err || !result){
console.log(err);
return res.json(returnCode.BUSY);
}
updateNoticIdx(preObj._id,idx,function(err,result){
if(err || !result){
console.log(err);
return res.json(returnCode.BUSY);
}
return res.json(_.assign({data:true}, returnCode.SUCCESS));
......
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