Commit 14b57d23 authored by 陈志良's avatar 陈志良

1

parent 45ffbc06
......@@ -468,4 +468,28 @@ router.get('/info/report/exportXlsReport/:id', function(req, res, next) {
err: '参数不合法'
});
}
});
//获取默认版块(创建时间最早的版块)
router.get('/info/default', function(req, res, next) {
var rs = {};
var ent_code = req.query.ent_code;
if(ent_code){
var conditions={
ent_code:ent_code
};
var sort = 'created'
forumInfoService.getOneInfoByConditionsAndSort(conditions,sort,function(err,info){
if(err){
console.error(err);
res.json(returnCode.BUSY);
}else{
rs.data = info;
res.json(_.assign(rs, returnCode.SUCCESS));
}
});
}else{
res.json(returnCode.BUSY);
}
});
\ No newline at end of file
......@@ -149,8 +149,10 @@ router.get('/thread/:tid/get', function(req, res, next) {
res.json(returnCode.BUSY);
} else {
var isSameAuthor = false;
if(results[0] && results[2] && results[0].from && results[0].from._id.toString() === results[2]._id.toString()){
isSameAuthor = true;
if(results[0].from && results[0].from.uid){
if(!isNaN(results[0].from.uid)){
isSameAuthor = true;
}
}
if (results[0].pid) {
......
......@@ -104,3 +104,17 @@ exports.updateInfoPvCount=function(fid,callback){
}
});
};
//获取板块
//获取全部列表数据
exports.getOneInfoByConditionsAndSort= function(conditions,sort,callback) {
ForumInfo.findOne(conditions).sort(sort).exec(function(err, doc) {
if (err || !doc) {
console.error(err);
callback(err,null);
} else {
callback(null,doc);
}
});
};
\ No newline at end of file
......@@ -170,7 +170,12 @@ exports.searchMembersAndLimitActions=function(pageNo, pageSize, q, callback){
//根据nickName查询用户
exports.searchMembersByNickName=function(nickName, callback){
var name = {nickName : { $regex: nickName, $options: 'i' } };
var name = {
$or : [
{nickName : { $regex: nickName, $options: 'i' }},
{displayName : { $regex: nickName, $options: 'i' }}
]
};
ForumUser.find(name).exec(function(err,result){
if(err){
callback(err,null);
......
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