Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pisns-forum-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scrmGroup
pisns-forum-api
Commits
0b98ff16
Commit
0b98ff16
authored
Oct 19, 2015
by
strong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bugfix_1019_comment_export'
parents
9f3a0a0f
a61352d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
forumThread.js
app/controllers/admin/forumThread.js
+16
-5
No files found.
app/controllers/admin/forumThread.js
View file @
0b98ff16
...
@@ -1123,7 +1123,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
...
@@ -1123,7 +1123,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
{
caption
:
'发帖人'
,
type
:
'string'
},
{
caption
:
'发帖人'
,
type
:
'string'
},
{
caption
:
'openId'
,
type
:
'string'
},
{
caption
:
'openId'
,
type
:
'string'
},
{
caption
:
'内容'
,
type
:
'string'
},
{
caption
:
'内容'
,
type
:
'string'
},
{
caption
:
'评论数'
,
type
:
'
number
'
},
{
caption
:
'评论数'
,
type
:
'
string
'
},
{
caption
:
'转发数'
,
type
:
'string'
},
{
caption
:
'转发数'
,
type
:
'string'
},
{
caption
:
'点赞数'
,
type
:
'string'
},
{
caption
:
'点赞数'
,
type
:
'string'
},
{
caption
:
'点赞人'
,
type
:
'string'
},
{
caption
:
'点赞人'
,
type
:
'string'
},
...
@@ -1137,9 +1137,19 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
...
@@ -1137,9 +1137,19 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
t_from_openId
=
thread
.
from
?
thread
.
from
.
uid
:
''
,
t_from_openId
=
thread
.
from
?
thread
.
from
.
uid
:
''
,
t_praiseNames
=
thread
.
praiseNames
,
t_praiseNames
=
thread
.
praiseNames
,
t_praiseOpenIds
=
thread
.
praiseOpenIds
;
t_praiseOpenIds
=
thread
.
praiseOpenIds
;
rows
.
push
([
t_title
,
t_time
,
t_from
,
t_from_openId
,
thread
.
content
,
thread
.
comment_count
,
thread
.
share_count
.
toString
(),
thread
.
praise_count
.
toString
(),
t_praiseNames
,
t_praiseOpenIds
]);
rows
.
push
([
t_title
,
t_time
,
t_from
,
t_from_openId
,
thread
.
content
,
thread
.
comment_count
.
toString
(),
thread
.
share_count
.
toString
(),
thread
.
praise_count
.
toString
(),
t_praiseNames
,
t_praiseOpenIds
]);
rows
.
push
([
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
]);
rows
.
push
([
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
,
''
]);
rows
.
push
([
'楼层'
,
'发布时间'
,
'openId'
,
'会员名'
,
'内容'
,
'点赞数'
,
'点赞人'
,
'点赞人openId'
,
''
,
''
]);
rows
.
push
([
'楼层'
,
'发布时间'
,
'openId'
,
'会员名'
,
'内容'
,
'点赞数'
,
'点赞人'
,
'点赞人openId'
,
null
,
null
]);
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
,
...
@@ -1159,7 +1169,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
...
@@ -1159,7 +1169,7 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
nickName
=
comment
.
from
.
nickName
||
'游客'
;
nickName
=
comment
.
from
.
nickName
||
'游客'
;
}
}
var
this_row
=
[
floor
+
''
,
time
,
openId
,
nickName
,
content
,
praiseCount
,
praiseNames
,
praiseOpenIds
,
null
,
null
];
var
this_row
=
[
floor
+
''
,
time
,
openId
,
nickName
,
encode
(
content
,
'utf-8'
),
praiseCount
.
toString
()
,
praiseNames
,
praiseOpenIds
,
null
,
null
];
rows
.
push
(
this_row
);
rows
.
push
(
this_row
);
if
(
comment
.
comments
.
length
>
0
){
if
(
comment
.
comments
.
length
>
0
){
for
(
var
k
=
0
;
k
<
comment
.
comments
.
length
;
k
++
)
{
for
(
var
k
=
0
;
k
<
comment
.
comments
.
length
;
k
++
)
{
...
@@ -1184,7 +1194,8 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
...
@@ -1184,7 +1194,8 @@ router.get('/thread/:tid/exportComments', function(req, res, next) {
};
};
conf
.
rows
=
rows
;
conf
.
rows
=
rows
;
var
result
=
nodeExcel
.
execute
(
conf
);
var
result
=
nodeExcel
.
execute
(
conf
);
res
.
setHeader
(
'Content-Type'
,
'application/vnd.ms-excel'
);
res
.
charset
=
'utf-8'
;
res
.
setHeader
(
'Content-Type'
,
'application/vnd.openxmlformats'
);
res
.
setHeader
(
'Content-Disposition'
,
'attachment; filename=commentsReport.xlsx'
);
res
.
setHeader
(
'Content-Disposition'
,
'attachment; filename=commentsReport.xlsx'
);
res
.
end
(
result
,
'binary'
);
res
.
end
(
result
,
'binary'
);
}).
fail
(
function
(
cont
,
err
){
}).
fail
(
function
(
cont
,
err
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment