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

添加点赞人openIds

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