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
b94dc9c6
Commit
b94dc9c6
authored
Mar 08, 2016
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
帖子管理增加时间、标题筛选条件
parent
088f47d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
forumThread.js
app/controllers/admin/forumThread.js
+19
-0
No files found.
app/controllers/admin/forumThread.js
View file @
b94dc9c6
...
@@ -398,6 +398,9 @@ router.get('/threads/list', function(req, res, next) {
...
@@ -398,6 +398,9 @@ router.get('/threads/list', function(req, res, next) {
var
eventStatus
=
req
.
query
.
eventStatus
;
var
eventStatus
=
req
.
query
.
eventStatus
;
var
recommend_threads
=
req
.
query
.
recommend_threads
;
//推荐帖子
var
recommend_threads
=
req
.
query
.
recommend_threads
;
//推荐帖子
var
top_threads
=
req
.
query
.
top_threads
;
//置顶帖子
var
top_threads
=
req
.
query
.
top_threads
;
//置顶帖子
var
begin_time
=
req
.
query
.
begin_time
;
var
end_time
=
req
.
query
.
end_time
;
var
title
=
req
.
query
.
title
;
var
sortBy
=
{
var
sortBy
=
{
top
:
-
1
,
top
:
-
1
,
top_order_idx
:
-
1
,
top_order_idx
:
-
1
,
...
@@ -476,6 +479,22 @@ router.get('/threads/list', function(req, res, next) {
...
@@ -476,6 +479,22 @@ router.get('/threads/list', function(req, res, next) {
conditions
[
'event.eventEndTime'
]
=
{
$gt
:
today
};
conditions
[
'event.eventEndTime'
]
=
{
$gt
:
today
};
}
}
}
}
if
(
begin_time
&&
end_time
){
conditions
.
created
=
{
$gte
:
begin_time
,
$lte
:
end_time
};
}
else
if
(
end_time
){
conditions
.
created
=
{
$lte
:
end_time
};
}
else
if
(
begin_time
){
conditions
.
created
=
{
$gte
:
begin_time
};
}
if
(
title
)
{
conditions
.
title
=
{
$regex
:
title
,
$options
:
'i'
}
}
if
(
mid
)
{
if
(
mid
)
{
forumThreadService
.
getAllThreadByFidAndMid
(
mid
,
conditions
,
pageNo
,
pageSize
,
sortBy
,
function
(
err
,
results
)
{
forumThreadService
.
getAllThreadByFidAndMid
(
mid
,
conditions
,
pageNo
,
pageSize
,
sortBy
,
function
(
err
,
results
)
{
if
(
err
)
{
if
(
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