Commit 09c10ee1 authored by 陈家荣's avatar 陈家荣

更新荣誉头衔和后台发的子话题不显示

parent 6404a060
......@@ -108,4 +108,28 @@ router.get('/honorTitle/list', function(req, res, next) {
res.json(_.assign(result, returnCode.SUCCESS));
}
});
});
//获取状态为启用的
router.get('/honorTitle/allList', function(req, res, next) {
var conditions={
ent_code:req.session.user.ent_code,
status:1
};
forumHonorTitleService.find(conditions, function(err,results){
if(err){
console.error(err);
res.json(returnCode.BUSY);
}else{
var map = {};
_.forEach(results, function(d, i) {
map[d._id] = d;
});
var rs = {
data:map
};
res.json(_.assign(rs, returnCode.SUCCESS));
}
});
});
\ No newline at end of file
......@@ -569,17 +569,6 @@ router.get('/thread/:tid/get', function(req, res, next) {
if (thread.toObject) {
thread = thread.toObject();
}
//获取等级最高的荣誉
if(thread.from && thread.from.honorTitles && thread.from.honorTitles.length > 0){
var temp_honorTitles = _.sortBy(thread.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){
thread.from.honorTitles = honor;
break;
}
}
}
var threads = [];
threads.push(thread);
util.loadLevel(req.session.user.ent_code, threads, function() {
......@@ -1695,10 +1684,8 @@ router.get('/thread/:tid/topics', function(req, res, next) {
var conditions = {
ent_code: req.session.user.ent_code,
pid: tid,
type: 2,
status: {
$ne: 3
}
// type: 2,
status: 1
};
if (tid) {
async.waterfall([
......@@ -1750,7 +1737,7 @@ router.get('/thread/:tid/latestPhotos', function(req, res, next) {
var conditions = {
ent_code: ent_code,
pid: tid,
type: 3,
// type: 3,
status: 1,
images: {
$exists: true,
......@@ -1824,7 +1811,7 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) {
var conditions = {
ent_code: ent_code,
pid: tid,
type: 3,
// type: 3,
status: 1,
images: {
$exists: true,
......@@ -2064,18 +2051,6 @@ function handleThreadList(req, results, ent_code, callback){
}
}
//获取等级最高的荣誉
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;
}
}
}
results.items[i].isPraise = false;
for (var k = docs.length - 1; k >= 0; k--) {
if (results.items[i]._id == docs[k]) {
......@@ -2144,7 +2119,7 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
var conditions = {
ent_code: ent_code,
pid: tid,
type: 2,
// type: 2,
status: 1
};
......
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