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
e8847ebd
Commit
e8847ebd
authored
Dec 17, 2015
by
陈家荣
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新排序,增加显示字段
parent
7e5c88fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
forumHonorTitle.js
app/models/forumHonorTitle.js
+5
-0
forumHonorTitleService.js
app/service/forumHonorTitleService.js
+3
-3
forumUserService.js
app/service/forumUserService.js
+6
-6
No files found.
app/models/forumHonorTitle.js
View file @
e8847ebd
...
...
@@ -26,6 +26,11 @@ var ForumHonorTitleSchema = new Schema({
require
:
true
,
default
:
1
},
is_show
:
{
//显示荣誉头衔状态,1显示,0不显示
type
:
Number
,
require
:
true
,
default
:
1
},
created
:
{
type
:
Date
,
required
:
true
,
...
...
app/service/forumHonorTitleService.js
View file @
e8847ebd
...
...
@@ -72,7 +72,7 @@ exports.getAll= function(conditions,pageNo,pageSize,callback) {
}
else
{
var
skip
=
(
pageNo
-
1
)
*
pageSize
;
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
ForumHonorTitle
.
find
(
conditions
,
null
,
{
skip
:
skip
,
limit
:
limit
,
sort
:{
order_idx
:
1
}},
function
(
err
,
docs
){
ForumHonorTitle
.
find
(
conditions
,
null
,
{
skip
:
skip
,
limit
:
limit
,
sort
:{
order_idx
:
-
1
}},
function
(
err
,
docs
){
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
...
...
@@ -91,7 +91,7 @@ exports.getAll= function(conditions,pageNo,pageSize,callback) {
//获取列表
exports
.
find
=
function
(
conditions
,
callback
){
ForumHonorTitle
.
find
(
conditions
).
sort
({
order_idx
:
1
}).
exec
(
function
(
err
,
docs
)
{
ForumHonorTitle
.
find
(
conditions
).
sort
({
order_idx
:
-
1
}).
exec
(
function
(
err
,
docs
)
{
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
...
...
@@ -102,7 +102,7 @@ exports.find=function(conditions,callback){
};
exports
.
getAllOrderIDX
=
function
(
conditions
,
callback
){
ForumHonorTitle
.
find
(
conditions
).
select
(
'_id order_idx'
).
sort
({
order_idx
:
1
}).
exec
(
function
(
err
,
docs
)
{
ForumHonorTitle
.
find
(
conditions
).
select
(
'_id order_idx'
).
sort
({
order_idx
:
-
1
}).
exec
(
function
(
err
,
docs
)
{
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
...
...
app/service/forumUserService.js
View file @
e8847ebd
...
...
@@ -24,7 +24,7 @@ exports.getUserByUid=function(uid,callback){
ForumUser
.
findOne
({
uid
:
uid
}).
populate
({
path
:
'honorTitles'
,
match
:
{
status
:
{
$ne
:
0
}},
options
:
{
sort
:{
order_idx
:
1
}
}
options
:
{
sort
:{
order_idx
:
-
1
}
}
}).
exec
(
function
(
err
,
result
){
if
(
err
){
callback
(
err
,
null
);
...
...
@@ -43,7 +43,7 @@ exports.getUserById=function(id,callback){
ForumUser
.
findOne
({
_id
:
id
}).
populate
({
path
:
'honorTitles'
,
match
:
{
status
:
{
$ne
:
0
}},
options
:
{
sort
:{
order_idx
:
1
}
}
options
:
{
sort
:{
order_idx
:
-
1
}
}
}).
exec
(
function
(
err
,
result
){
if
(
err
){
callback
(
err
,
null
);
...
...
@@ -79,7 +79,7 @@ exports.searchMembers=function(pageNo, pageSize, q, callback){
ForumUser
.
find
(
q
).
skip
(
skip
).
limit
(
limit
).
sort
(
'-created'
).
populate
({
path
:
'honorTitles'
,
match
:
{
status
:
{
$ne
:
0
}},
options
:
{
sort
:{
order_idx
:
1
}
}
options
:
{
sort
:{
order_idx
:
-
1
}
}
}).
exec
(
function
(
err
,
docs
)
{
cont
(
err
,
count
,
docs
);
});
...
...
@@ -111,7 +111,7 @@ exports.searchMembersByNickName=function(nickName, callback){
ForumUser
.
find
(
name
).
populate
({
path
:
'honorTitles'
,
match
:
{
status
:
{
$ne
:
0
}},
options
:
{
sort
:{
order_idx
:
1
}
}
options
:
{
sort
:{
order_idx
:
-
1
}
}
}).
exec
(
function
(
err
,
result
){
if
(
err
){
callback
(
err
,
null
);
...
...
@@ -126,7 +126,7 @@ exports.searchMembersByMid=function(mid, callback){
ForumUser
.
find
({
mid
:
mid
}).
populate
({
path
:
'honorTitles'
,
match
:
{
status
:
{
$ne
:
0
}},
options
:
{
sort
:{
order_idx
:
1
}
}
options
:
{
sort
:{
order_idx
:
-
1
}
}
}).
exec
(
function
(
err
,
result
){
if
(
err
){
callback
(
err
,
null
);
...
...
@@ -146,7 +146,7 @@ exports.searchMembersAndLimitActions=function(pageNo, pageSize, q, callback){
ForumUser
.
find
(
q
).
skip
(
skip
).
limit
(
limit
).
sort
(
'-created'
).
populate
({
path
:
'honorTitles'
,
match
:
{
status
:
{
$ne
:
0
}},
options
:
{
sort
:{
order_idx
:
1
}
}
options
:
{
sort
:{
order_idx
:
-
1
}
}
}).
exec
(
function
(
err
,
docs
)
{
cont
(
err
,
count
,
docs
);
});
...
...
strong
@strong
mentioned in commit
1884df38
·
Dec 17, 2015
mentioned in commit
1884df38
mentioned in commit 1884df3857aaafe7ddd8ed2c4783727e3c4cc8eb
Toggle commit list
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