Commit 414434c8 authored by 陈家荣's avatar 陈家荣

更新荣誉列表

parent 68658031
......@@ -307,10 +307,6 @@ router.get('/sharev2.js', function(req, res, next) {
var title = '',desc = '',imgUrl = '';
var key = ent_code + 'forum_share_index_info';
console.log('----------- in ---------');
console.log(type);
if(type && type === 'index'){
var expire = 60 * 60;
redis.get(key, function(error, share){
......@@ -451,13 +447,9 @@ router.get('/sharev2.js', function(req, res, next) {
share_log.p_thread = thread.pid;
share_log.info = thread.info._id || thread.info;
share_log.thread_type = thread.pid?4:thread.type;
//替换分享log内容
req.session.shareLog = share_log;
console.log(' new session -----------> ');
console.log(req.session.shareLog);
//组装分享路径与判断分享类型
var baseParamsUrl = '&infoId=' + thread.info._id + '&ent_code=' + ent_code + '&tId=' + thread._id +'&uId='+uId;
......
......@@ -1953,7 +1953,13 @@ function handleThreadList(req, results, ent_code, callback){
//获取等级最高的荣誉
if(results.items[i].from.honorTitles && results.items[i].from.honorTitles.length > 0){
var temp_honorTitles = _.sortBy(results.items[i].from.honorTitles, 'order_idx')
results.items[i].from.honorTitles = temp_honorTitles[temp_honorTitles.length - 1];
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;
......
......@@ -142,7 +142,6 @@ exports.createLog = function(req,source,info,type,thread_type,thread,p_thread) {
};
exports.createShareLog = function(req,share_type) {
console.log('----------- in createShareLog ---------');
var logObj = req.session.shareLog || {};
logObj.source = req.session.mobileForumUser.source;
logObj.mid = req.session.openUser.mid;
......@@ -161,7 +160,6 @@ exports.createShareLog = function(req,share_type) {
}).then(function(cont){
if(logObj.thread){
ForumThread.update({_id:logObj.thread},{$inc:{share_count:1}},function(err){
console.log('----------- update share_count success ---------');
cont(err);
});
}
......
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