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
9dd900c6
Commit
9dd900c6
authored
Aug 04, 2015
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取文章的服务
parent
c09508c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
forumThreadService.js
app/service/forumThreadService.js
+25
-0
No files found.
app/service/forumThreadService.js
View file @
9dd900c6
...
@@ -3,6 +3,7 @@ var mongoose = require('mongoose');
...
@@ -3,6 +3,7 @@ var mongoose = require('mongoose');
var
ForumThread
=
mongoose
.
model
(
'ForumThread'
);
var
ForumThread
=
mongoose
.
model
(
'ForumThread'
);
var
ForumComment
=
mongoose
.
model
(
'ForumComment'
);
var
ForumComment
=
mongoose
.
model
(
'ForumComment'
);
var
ForumShare
=
mongoose
.
model
(
'ForumShare'
);
var
ForumShare
=
mongoose
.
model
(
'ForumShare'
);
var
ForumUser
=
mongoose
.
model
(
'ForumUser'
);
var
forumCommentService
=
require
(
'./forumCommentService'
);
var
forumCommentService
=
require
(
'./forumCommentService'
);
...
@@ -970,3 +971,27 @@ exports.remove = function(array,val) {
...
@@ -970,3 +971,27 @@ exports.remove = function(array,val) {
}
}
return
array
;
return
array
;
};
};
// 根据nickName查询文章
exports
.
getAllThreadByNickName
=
function
(
nickName
,
conditions
,
pageNo
,
pageSize
,
sort
,
callback
)
{
then
(
function
(
cont
)
{
ForumUser
.
findOne
({
nickName
:
nickName
}).
exec
(
function
(
err
,
result
){
if
(
err
){
cont
(
err
,
null
);
}
else
{
cont
(
null
,
result
);
}
});
}).
then
(
function
(
cont
,
user
)
{
if
(
user
){
conditions
.
from
=
user
.
_id
;
getAllThreadByFidHelp
(
conditions
,
pageNo
,
pageSize
,
sort
,
callback
);
}
else
{
callback
(
err
,
null
);
}
}).
fail
(
function
(
cont
,
err
)
{
console
.
log
(
err
);
callback
(
err
,
null
);
});
};
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