mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-06-17 20:21:41 +02:00
fix(forums): today new topics and new replies count
This commit is contained in:
@@ -51,12 +51,20 @@ exports.list = function (req, res) {
|
||||
Topic.aggregate({
|
||||
$project: {
|
||||
'forum': '$forum',
|
||||
'year': {
|
||||
'$year': '$createdAt'
|
||||
},
|
||||
'month': {
|
||||
'$month': '$createdAt'
|
||||
},
|
||||
'day': {
|
||||
'$dayOfMonth': '$createdAt'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
$match: {
|
||||
year: moment.utc().year(),
|
||||
month: moment.utc().month() + 1,
|
||||
day: moment.utc().date()
|
||||
}
|
||||
}, {
|
||||
@@ -79,14 +87,20 @@ exports.list = function (req, res) {
|
||||
}, {
|
||||
$project: {
|
||||
'forum': '$forum',
|
||||
//'title': '$title',
|
||||
//'createdAt': '$_replies.createdAt',
|
||||
'year': {
|
||||
'$year': '$_replies.createdAt'
|
||||
},
|
||||
'month': {
|
||||
'$month': '$_replies.createdAt'
|
||||
},
|
||||
'day': {
|
||||
'$dayOfMonth': '$_replies.createdAt'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
$match: {
|
||||
year: moment.utc().year(),
|
||||
month: moment.utc().month() + 1,
|
||||
day: moment.utc().date()
|
||||
}
|
||||
}, {
|
||||
|
||||
Reference in New Issue
Block a user