Commit 575441b3 authored by 陈家荣's avatar 陈家荣

33

parent df044b44
......@@ -1021,17 +1021,13 @@ router.get('/thread/:tid/spreadchain', function(req, res, next) {
// 导出文章评论内容
router.get('/thread/:tid/exportComments', function(req, res, next) {
var tid = req.params.tid || null;
// var ent_code = req.query.ent_code;
if(req.query.ent_code){
var ent_code = req.query.ent_code;
}else{
var ent_code = 100056;
}
if(tid){
var conditions = {
ent_code: ent_code,
thread: tid
......@@ -1081,7 +1077,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
//表头
var conf = {};
conf.cols = [
{caption:'楼层', type:'number'},
{caption:'楼层', type:'string'},
{caption:'发布时间', type:'Date'},
{caption:'会员名', type:'string'},
{caption:'内容', type:'string'},
......@@ -1105,37 +1101,21 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
praiseNames = comment.praiseNames.toString();
}
var this_row = [floor, time, nickName, content, praiseCount, praiseNames];
var this_row = [floor + '', time, nickName, content, praiseCount, praiseNames];
rows.push(this_row);
if(comment.comments.length > 0){
for (var i = comment.comments.length - 1; i >= 0; i--) {
var sub_comment = comment.comments[i];
var floor = sub_comment.floor;
var time = date_format(sub_comment.created);
var nickName = sub_comment.from.nickName || '';
var content = sub_comment.content || '';
var praiseCount = sub_comment.praiseCount || 0;
var praiseNames = '';
if(comment.praiseNames){
praiseNames = comment.praiseNames.toString();
}
var this_row = [null, time, nickName, content, praiseCount, praiseNames];
var this_row = ['子评论', time, nickName, content, null, null];
rows.push(this_row);
// console.log(time);
// console.log(nickName);
// console.log(content);
// console.log(praiseNames);
// console.log(praiseCount);
};
}
};
conf.rows = rows;
......
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