Commit 7f823748 authored by 刘文胜's avatar 刘文胜

帖子评论接口 过滤掉status=2的数据 并且可以指定降序还是升序

parent 572274a5
......@@ -898,16 +898,23 @@ router.get('/threadManagement/threads/:tid/comment/search', function(req, res, n
mid = req.query.mid,
floor_start = req.query.floor_start,
floor_end = req.query.floor_end,
content = req.query.content || '',
sortBy = req.query.sort;
var sort = {};
if(sortBy){
sort[sortBy] = -1;
content = req.query.content || '';
var asc = req.query.asc === 'true'?1:-1;
var sort = {//默认排序
floor:asc
};
if(req.query.sort){//指定排序字段
sort = {};
sort[req.query.sort] = asc;
}
var conditions = {
ent_code: req.session.user.ent_code,
thread: tid,
level:1
level:1,
status:{
$ne:2
}
};
if (content) {
conditions.content = {
......@@ -960,7 +967,10 @@ router.post('/threadManagement/threads/:tid/comment/search/deleteAll', function(
var conditions = {
ent_code: ent_code,
thread: tid,
level:1
level:1,
status:{
$ne:2
}
};
if (content) {
conditions.content = {
......@@ -1050,7 +1060,10 @@ router.post('/threadManagement/threads/:tid/comment/search/closeAll', function(r
var conditions = {
ent_code: ent_code,
thread: tid,
level:1
level:1,
status:{
$ne:2
}
};
if (content) {
conditions.content = {
......
......@@ -440,7 +440,10 @@ function getCommentBatchOperateConditions(req){
var conditions = {
ent_code: ent_code,
thread: tid,
level:1
level:1,
status:{
$ne:2
}
};
if (content) {
conditions.content = {
......
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