Commit 6edf6c04 authored by strong's avatar strong

Merge commit '09c10ee1' into SANDBOX

parents fbc9f3ee 09c10ee1
...@@ -108,4 +108,28 @@ router.get('/honorTitle/list', function(req, res, next) { ...@@ -108,4 +108,28 @@ router.get('/honorTitle/list', function(req, res, next) {
res.json(_.assign(result, returnCode.SUCCESS)); 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) { ...@@ -569,17 +569,6 @@ router.get('/thread/:tid/get', function(req, res, next) {
if (thread.toObject) { if (thread.toObject) {
thread = 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 = []; var threads = [];
threads.push(thread); threads.push(thread);
util.loadLevel(req.session.user.ent_code, threads, function() { util.loadLevel(req.session.user.ent_code, threads, function() {
...@@ -1695,10 +1684,8 @@ router.get('/thread/:tid/topics', function(req, res, next) { ...@@ -1695,10 +1684,8 @@ router.get('/thread/:tid/topics', function(req, res, next) {
var conditions = { var conditions = {
ent_code: req.session.user.ent_code, ent_code: req.session.user.ent_code,
pid: tid, pid: tid,
type: 2, // type: 2,
status: { status: 1
$ne: 3
}
}; };
if (tid) { if (tid) {
async.waterfall([ async.waterfall([
...@@ -1750,7 +1737,7 @@ router.get('/thread/:tid/latestPhotos', function(req, res, next) { ...@@ -1750,7 +1737,7 @@ router.get('/thread/:tid/latestPhotos', function(req, res, next) {
var conditions = { var conditions = {
ent_code: ent_code, ent_code: ent_code,
pid: tid, pid: tid,
type: 3, // type: 3,
status: 1, status: 1,
images: { images: {
$exists: true, $exists: true,
...@@ -1824,7 +1811,7 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) { ...@@ -1824,7 +1811,7 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) {
var conditions = { var conditions = {
ent_code: ent_code, ent_code: ent_code,
pid: tid, pid: tid,
type: 3, // type: 3,
status: 1, status: 1,
images: { images: {
$exists: true, $exists: true,
...@@ -2064,18 +2051,6 @@ function handleThreadList(req, results, ent_code, callback){ ...@@ -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; results.items[i].isPraise = false;
for (var k = docs.length - 1; k >= 0; k--) { for (var k = docs.length - 1; k >= 0; k--) {
if (results.items[i]._id == docs[k]) { if (results.items[i]._id == docs[k]) {
...@@ -2144,7 +2119,7 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) { ...@@ -2144,7 +2119,7 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
var conditions = { var conditions = {
ent_code: ent_code, ent_code: ent_code,
pid: tid, pid: tid,
type: 2, // type: 2,
status: 1 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