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
fb26d915
Commit
fb26d915
authored
Jul 07, 2015
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改论坛文章获取日期的函数
parent
fd1effd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
forumLog.js
app/controllers/admin/forumLog.js
+10
-3
No files found.
app/controllers/admin/forumLog.js
View file @
fb26d915
...
...
@@ -19,6 +19,8 @@ var ForumPvLog = mongoose.model('ForumPVLog'),
ForumUser
=
mongoose
.
model
(
'ForumUser'
),
ForumThread
=
mongoose
.
model
(
'ForumThread'
);
var
Mongoose
=
require
(
'mongoose'
);
var
ObjectId
=
Mongoose
.
Types
.
ObjectId
;
module
.
exports
=
function
(
app
)
{
app
.
use
(
'/admin/forum'
,
router
);
...
...
@@ -50,7 +52,11 @@ function date_format(date) {
//获取日期之间所有日期
function
get_all_date
(
begin
,
end
)
{
var
date_array
=
[];
if
(
begin
===
end
)
return
date_array
;
// if (begin === end) return date_array;
if
(
begin
===
end
){
date_array
.
push
(
end
.
replace
(
/-/g
,
"/"
));
return
date_array
;
}
var
ab
=
begin
.
split
(
'-'
);
var
ae
=
end
.
split
(
'-'
);
var
db
=
new
Date
();
...
...
@@ -395,13 +401,14 @@ router.post('/getThreadActionStatistic', function(req, res, next) {
mapReduce
(
ForumPraiseLog
,
match
,
group
,
d
,
cont
);
});
});
//统计所有评论
var
comment_tasks
=
[];
_
.
forEach
(
all_data_array
,
function
(
d
)
{
comment_tasks
.
push
(
function
(
cont
)
{
var
match
=
{
thread
:
t_id
,
// thread: t_id,
thread
:
new
ObjectId
(
t_id
),
created
:
{
$gte
:
new
Date
(
d
+
' 00:00:00'
),
$lte
:
new
Date
(
d
+
' 23:59:59'
)
...
...
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