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
fcdd288b
Commit
fcdd288b
authored
Dec 16, 2015
by
陈家荣
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化帖子报表代码
parent
fc45c344
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
471 deletions
+20
-471
forumLog.js
app/controllers/admin/forumLog.js
+20
-36
forumThread.js
app/controllers/mobile/forumThread.js
+0
-435
No files found.
app/controllers/admin/forumLog.js
View file @
fcdd288b
...
@@ -89,6 +89,22 @@ function mapReduce(model, match, group, date, callback) {
...
@@ -89,6 +89,22 @@ function mapReduce(model, match, group, date, callback) {
});
});
}
}
//统计数量
function
count
(
model
,
match
,
date
,
callback
)
{
model
.
count
(
match
,
function
(
err
,
count
)
{
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
}
else
{
var
data
=
{
date
:
date
,
count
:
count
};
callback
(
null
,
data
);
}
});
}
//统计
//统计
function
countSex
(
t_id
,
sex
,
callback
)
{
function
countSex
(
t_id
,
sex
,
callback
)
{
...
@@ -366,15 +382,7 @@ router.post('/getThreadActionStatistic', function(req, res, next) {
...
@@ -366,15 +382,7 @@ router.post('/getThreadActionStatistic', function(req, res, next) {
}
}
}
}
};
};
var
group
=
{
count
(
ForumUserThreadControl
,
match
,
d
,
cont
);
_id
:
{
_id
:
'$_id'
},
count
:
{
$sum
:
1
}
};
mapReduce
(
ForumUserThreadControl
,
match
,
group
,
d
,
cont
);
});
});
});
});
...
@@ -390,15 +398,7 @@ router.post('/getThreadActionStatistic', function(req, res, next) {
...
@@ -390,15 +398,7 @@ router.post('/getThreadActionStatistic', function(req, res, next) {
$lte
:
new
Date
(
d
+
' 23:59:59'
)
$lte
:
new
Date
(
d
+
' 23:59:59'
)
}
}
};
};
var
group
=
{
count
(
ForumPraiseLog
,
match
,
d
,
cont
);
_id
:
{
_id
:
'$_id'
},
count
:
{
$sum
:
1
}
};
mapReduce
(
ForumPraiseLog
,
match
,
group
,
d
,
cont
);
});
});
});
});
...
@@ -414,15 +414,7 @@ router.post('/getThreadActionStatistic', function(req, res, next) {
...
@@ -414,15 +414,7 @@ router.post('/getThreadActionStatistic', function(req, res, next) {
$lte
:
new
Date
(
d
+
' 23:59:59'
)
$lte
:
new
Date
(
d
+
' 23:59:59'
)
}
}
};
};
var
group
=
{
count
(
ForumComment
,
match
,
d
,
cont
);
_id
:
{
_id
:
'$_id'
},
count
:
{
$sum
:
1
}
};
mapReduce
(
ForumComment
,
match
,
group
,
d
,
cont
);
});
});
});
});
...
@@ -438,15 +430,7 @@ router.post('/getThreadActionStatistic', function(req, res, next) {
...
@@ -438,15 +430,7 @@ router.post('/getThreadActionStatistic', function(req, res, next) {
$lte
:
new
Date
(
d
+
' 23:59:59'
)
$lte
:
new
Date
(
d
+
' 23:59:59'
)
}
}
};
};
var
group
=
{
count
(
ForumShareLog
,
match
,
d
,
cont
);
_id
:
{
_id
:
'$_id'
},
count
:
{
$sum
:
1
}
};
mapReduce
(
ForumShareLog
,
match
,
group
,
d
,
cont
);
});
});
});
});
...
...
app/controllers/mobile/forumThread.js
View file @
fcdd288b
This diff is collapsed.
Click to expand it.
strong
@strong
mentioned in commit
735e9137
·
Dec 16, 2015
mentioned in commit
735e9137
mentioned in commit 735e91378fcef89a89807343c95fb691d0e3b500
Toggle commit list
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