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
4b5bd228
Commit
4b5bd228
authored
Apr 16, 2015
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新了文章评论
parent
9f314d69
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
forumCommentService.js
app/service/forumCommentService.js
+6
-3
No files found.
app/service/forumCommentService.js
View file @
4b5bd228
'use strict'
;
'use strict'
;
var
mongoose
=
require
(
'mongoose'
);
var
mongoose
=
require
(
'mongoose'
);
var
ForumComment
=
mongoose
.
model
(
'ForumComment'
);
var
ForumComment
=
mongoose
.
model
(
'ForumComment'
);
...
@@ -30,12 +32,13 @@ exports.getCommentById=function(cid,callback){
...
@@ -30,12 +32,13 @@ exports.getCommentById=function(cid,callback){
};
};
//根据ID更新评论
//根据ID更新评论
exports
.
updateCommentById
=
function
(
cid
,
entity
,
callback
){
exports
.
updateCommentById
=
function
(
cid
,
status
,
callback
){
ForumComment
.
update
({
_id
:
cid
},
entity
,
null
,
function
(
err
,
result
){
ForumComment
.
update
({
_id
:
cid
},
{
"status"
:
status
}
,
null
,
function
(
err
,
result
){
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
callback
(
err
,
null
);
}
else
{
}
else
{
console
.
log
(
result
);
callback
(
null
,
null
);
callback
(
null
,
null
);
}
}
});
});
...
@@ -74,7 +77,7 @@ exports.getAllComment= function(conditions,pageNo,pageSize,callback) {
...
@@ -74,7 +77,7 @@ exports.getAllComment= function(conditions,pageNo,pageSize,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
);
console
.
log
(
"count:"
+
count
);
ForumComment
.
find
(
conditions
).
populate
(
'from'
).
populate
(
'to'
).
limit
(
limit
).
skip
(
skip
).
sort
(
'-created'
).
exec
(
function
(
err
,
docs
)
{
ForumComment
.
find
(
conditions
).
populate
(
'from'
).
populate
(
'to'
).
limit
(
limit
).
skip
(
skip
).
sort
(
'-created'
).
exec
(
function
(
err
,
docs
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
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