Commit d33c609a authored by 陈家荣's avatar 陈家荣

我的消息增加头衔回复

parent 4a8f4085
......@@ -41,6 +41,23 @@ router.get('/aboutme/other2me', function(req, res, next) {
if (err) {
res.json(returnCode.UNCHECK_ERROR(err));
} else {
_.forEach(results.items, function(d, i) {
if (results.items[i].toObject) {
results.items[i] = results.items[i].toObject();
}
//获取等级最高的荣誉
if(results.items[i].from && results.items[i].from.honorTitles && results.items[i].from.honorTitles.length > 0){
var temp_honorTitles = _.sortBy(results.items[i].from.honorTitles, 'order_idx')
for(var m = temp_honorTitles.length - 1; m >= 0; m-=1){
var honor = temp_honorTitles[m]
if(honor.is_show == 1){
results.items[i].from.honorTitles = honor;
break;
}
}
}
});
util.loadLevel(req.session.user.ent_code,results.items,function(){
res.json(_.assign(results, returnCode.SUCCESS));
});
......
......@@ -441,7 +441,10 @@ exports.other2me=function(ent_code,id,pageNo,pageSize,callback){
var sortBy = '-created';
ForumAboutMe.find(condition).populate({
path: 'from to commentLevel1From commentLevel2ThreadFrom',
select: 'uid nickName icon displayName displayIcon classLevel'
select: 'uid nickName icon displayName displayIcon classLevel honorTitles',
options: {
populate:"honorTitles" //继续查荣誉
}
}).populate({
path: 'thread',
select: '-title -topTime -tag_topTime -tag -comments -created'
......
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