Commit 9ea176ea authored by 陈志良's avatar 陈志良

11

parent d242c6a0
...@@ -226,6 +226,8 @@ router.get('/threads/list', function(req, res, next) { ...@@ -226,6 +226,8 @@ router.get('/threads/list', function(req, res, next) {
var tagId = req.query.tagId; var tagId = req.query.tagId;
var pid = req.query.pid; var pid = req.query.pid;
var content = req.query.content; var content = req.query.content;
var type = req.query.type;
var status = req.query.status;
var conditions = { var conditions = {
ent_code: req.session.user.ent_code, ent_code: req.session.user.ent_code,
level: 1 level: 1
...@@ -250,15 +252,21 @@ router.get('/threads/list', function(req, res, next) { ...@@ -250,15 +252,21 @@ router.get('/threads/list', function(req, res, next) {
$options: 'i' $options: 'i'
} }
} }
if(type){
conditions.type = type;
}
if(status){
conditions.status = status;
}
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);
res.json(returnCode.BUSY); res.json(returnCode.BUSY);
} else { } else {
if (results.items.length > 0 && results.items[0].pid) { if (pid) {
forumThreadService.getById(results.items[0].pid, function(err, parentThread) { forumThreadService.getById(pid, function(err, parentThread) {
res.json(_.assign({ res.json(_.assign({
parentThread: parentThread parentThread: parentThread
}, results, returnCode.SUCCESS)); }, results, 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