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
61ee192e
Commit
61ee192e
authored
Sep 10, 2015
by
许文聪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
按日期降序排序
parent
593d7733
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
17 deletions
+9
-17
forumModerator.js
app/controllers/admin/forumModerator.js
+2
-12
forumModeratorService.js
app/service/forumModeratorService.js
+7
-5
No files found.
app/controllers/admin/forumModerator.js
View file @
61ee192e
...
@@ -13,9 +13,6 @@ var forumModeratorService=require('../../service/forumModeratorService');
...
@@ -13,9 +13,6 @@ var forumModeratorService=require('../../service/forumModeratorService');
var
ForumModerator
=
mongoose
.
model
(
'ForumModerator'
),
var
ForumModerator
=
mongoose
.
model
(
'ForumModerator'
),
ForumPVLog
=
mongoose
.
model
(
'ForumPVLog'
);
ForumPVLog
=
mongoose
.
model
(
'ForumPVLog'
);
module
.
exports
=
function
(
app
)
{
module
.
exports
=
function
(
app
)
{
app
.
use
(
'/admin/forum'
,
router
);
app
.
use
(
'/admin/forum'
,
router
);
};
};
...
@@ -55,7 +52,6 @@ router.get('/moderator/list', function(req, res, next){
...
@@ -55,7 +52,6 @@ router.get('/moderator/list', function(req, res, next){
t
.
setDate
(
t
.
getDate
()
+
1
);
t
.
setDate
(
t
.
getDate
()
+
1
);
conditions
.
created
[
'$lte'
]
=
t
;
conditions
.
created
[
'$lte'
]
=
t
;
}
}
}
}
if
(
behavior
)
if
(
behavior
)
{
{
...
@@ -67,10 +63,7 @@ router.get('/moderator/list', function(req, res, next){
...
@@ -67,10 +63,7 @@ router.get('/moderator/list', function(req, res, next){
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
res
.
json
(
_
.
assign
(
results
,
returnCode
.
SUCCESS
));
res
.
json
(
_
.
assign
(
results
,
returnCode
.
SUCCESS
));
}
}
});
});
}
else
}
else
...
@@ -80,10 +73,7 @@ router.get('/moderator/list', function(req, res, next){
...
@@ -80,10 +73,7 @@ router.get('/moderator/list', function(req, res, next){
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
res
.
json
(
_
.
assign
(
results
,
returnCode
.
SUCCESS
));
res
.
json
(
_
.
assign
(
results
,
returnCode
.
SUCCESS
));
}
}
});
});
}
}
...
...
app/service/forumModeratorService.js
View file @
61ee192e
...
@@ -26,8 +26,12 @@ function getAllOperationByFidHelp(conditions, pageNo, pageSize, sort, callback)
...
@@ -26,8 +26,12 @@ function getAllOperationByFidHelp(conditions, pageNo, pageSize, sort, callback)
}
else
{
}
else
{
var
skip
=
(
pageNo
-
1
)
*
pageSize
;
var
skip
=
(
pageNo
-
1
)
*
pageSize
;
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
var
sortBy
=
'-created'
;
if
(
sort
)
{
sortBy
=
sort
;
}
ForumModerator
.
find
(
conditions
).
populate
(
'info'
).
skip
(
skip
).
limit
(
limit
).
exec
(
function
(
err
,
docs
)
{
ForumModerator
.
find
(
conditions
).
populate
(
'info'
).
limit
(
limit
).
skip
(
skip
).
sort
(
sortBy
).
exec
(
function
(
err
,
docs
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
callback
(
err
,
null
);
...
@@ -67,10 +71,9 @@ function getAllOperationByFidHelpAndNickName(userName, conditions, pageNo, pageS
...
@@ -67,10 +71,9 @@ function getAllOperationByFidHelpAndNickName(userName, conditions, pageNo, pageS
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
callback
(
err
,
null
);
}
else
{
}
else
{
var
skip
=
(
pageNo
-
1
)
*
pageSize
;
var
skip
=
(
pageNo
-
1
)
*
pageSize
;
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
var
sortBy
=
'-
topTime -tag_topTime -
created'
;
var
sortBy
=
'-created'
;
if
(
sort
)
{
if
(
sort
)
{
sortBy
=
sort
;
sortBy
=
sort
;
}
}
...
@@ -79,7 +82,6 @@ function getAllOperationByFidHelpAndNickName(userName, conditions, pageNo, pageS
...
@@ -79,7 +82,6 @@ function getAllOperationByFidHelpAndNickName(userName, conditions, pageNo, pageS
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
callback
(
err
,
null
);
}
else
{
}
else
{
var
obj
=
{};
var
obj
=
{};
obj
.
total
=
count
;
obj
.
total
=
count
;
obj
.
pageNo
=
pageNo
;
obj
.
pageNo
=
pageNo
;
...
...
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