Commit e2c8aa70 authored by 陈志良's avatar 陈志良

添加点赞人openIds

parent c6443107
...@@ -1057,10 +1057,13 @@ router.get('/thread/:tid/exportComments', function(req, res, next) { ...@@ -1057,10 +1057,13 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
}else{ }else{
if(results){ if(results){
var praiseNames = []; var praiseNames = [];
var praiseOpenIds = [];
_.forEach(results, function(e2) { _.forEach(results, function(e2) {
praiseNames.push(e2.user.nickName || '游客'); praiseNames.push(e2.user.nickName || '游客');
praiseOpenIds.push(e2.user.uid);
}); });
e.praiseNames = praiseNames; e.praiseNames = praiseNames;
e.praiseOpenIds = praiseOpenIds;
e.praiseCount = results.length; e.praiseCount = results.length;
} }
cb(null, e); cb(null, e);
...@@ -1081,6 +1084,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) { ...@@ -1081,6 +1084,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
{caption:'内容', type:'string'}, {caption:'内容', type:'string'},
{caption:'点赞数', type:'number'}, {caption:'点赞数', type:'number'},
{caption:'点赞人', type:'string'}, {caption:'点赞人', type:'string'},
{caption:'点赞人openId', type:'string'}
]; ];
//内容 //内容
...@@ -1089,18 +1093,20 @@ router.get('/thread/:tid/exportComments', function(req, res, next) { ...@@ -1089,18 +1093,20 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
for (var i = items.length - 1; i >= 0; i--) { for (var i = items.length - 1; i >= 0; i--) {
var comment = items[i]; var comment = items[i];
var floor = comment.floor; var floor = comment.floor,
var time = date_format(comment.created); time = date_format(comment.created),
var openId = comment.from.uid || ''; openId = comment.from.uid || '',
var nickName = comment.from.nickName || '游客'; nickName = comment.from.nickName || '游客',
var content = comment.content || ''; content = comment.content || '',
var praiseCount = comment.praiseCount || 0; praiseCount = comment.praiseCount || 0,
var praiseNames = ''; praiseNames = '',
praiseOpenIds = '';
if(comment.praiseNames){ if(comment.praiseNames){
praiseNames = comment.praiseNames.toString(); praiseNames = comment.praiseNames.toString();
praiseOpenIds = comment.praiseOpenIds.toString();
} }
var this_row = [floor + '', time,openId, nickName, content, praiseCount, praiseNames]; var this_row = [floor + '', time,openId, nickName, content, praiseCount, praiseNames,praiseOpenIds];
rows.push(this_row); rows.push(this_row);
if(comment.comments.length > 0){ if(comment.comments.length > 0){
...@@ -1112,7 +1118,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) { ...@@ -1112,7 +1118,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
var nickName = sub_comment.from.nickName || '游客'; var nickName = sub_comment.from.nickName || '游客';
var content = sub_comment.content || ''; var content = sub_comment.content || '';
var this_row = ['回复', time,openId, nickName, content, null, null]; var this_row = ['回复', time,openId, nickName, content, null, null,null];
rows.push(this_row); rows.push(this_row);
}; };
} }
......
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