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
c02906a1
Commit
c02906a1
authored
Jun 21, 2016
by
strong
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
528f8843
'
parents
5eaf6846
528f8843
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
forumAboutMe.js
app/models/forumAboutMe.js
+3
-3
forumAboutMEService.js
app/service/forumAboutMEService.js
+18
-7
No files found.
app/models/forumAboutMe.js
View file @
c02906a1
...
...
@@ -32,8 +32,8 @@ var ForumAboutMeSchema = new Schema({
index
:
true
,
ref
:
'ForumThread'
,
require
:
true
},
threadStatus
:{
},
threadStatus
:{
//0屏蔽 1.正常, 2删除
type
:
Number
},
commentLevel1
:{
//一级评论
...
...
@@ -48,7 +48,7 @@ var ForumAboutMeSchema = new Schema({
index
:
true
,
ref
:
'ForumUser'
},
commentLevel1Status
:{
commentLevel1Status
:{
//0屏蔽 1.正常, 2删除
type
:
Number
},
commentLevel2
:{
//二级评论
...
...
app/service/forumAboutMEService.js
View file @
c02906a1
...
...
@@ -297,7 +297,6 @@ exports.saveCommentLevel2BySearch=function(tid,l1id,l2id){
exports
.
updateThreadStatus
=
function
(
tid
,
status
){
var
condition
=
{
type
:
THREAD_TYPE
,
thread
:
new
mongoose
.
Types
.
ObjectId
(
tid
),
threadStatus
:{
$ne
:
status
}
}
...
...
@@ -321,7 +320,6 @@ exports.updateThreadStatus=function(tid,status){
exports
.
updateCommentLevel1Status
=
function
(
cid
,
status
){
var
condition
=
{
type
:
COMMENTLEVEL1_TYPE
,
commentLevel1
:
new
mongoose
.
Types
.
ObjectId
(
cid
),
commentLevel1Status
:{
$ne
:
status
}
}
...
...
@@ -345,7 +343,6 @@ exports.updateCommentLevel1Status=function(cid,status){
exports
.
updateCommentLevel2Status
=
function
(
cid
,
status
){
var
condition
=
{
type
:
COMMENTLEVEL2_TYPE
,
commentLevel2
:
new
mongoose
.
Types
.
ObjectId
(
cid
),
commentLevel2Status
:{
$ne
:
status
}
}
...
...
@@ -371,12 +368,20 @@ exports.me2other=function(ent_code,id,pageNo,pageSize,callback){
var
condition
=
{
ent_code
:
ent_code
,
from
:
new
mongoose
.
Types
.
ObjectId
(
id
),
// $or:[{
// type:THREAD_TYPE,threadStatus:1
// },{
// type:COMMENTLEVEL1_TYPE,threadStatus:1,commentLevel1Status:1
// },{
// type:COMMENTLEVEL2_TYPE,threadStatus:1,commentLevel1Status:1,commentLevel2Status:1
// }]
$or
:[{
type
:
THREAD_TYPE
,
threadStatus
:
1
},{
type
:
COMMENTLEVEL1_TYPE
,
threadStatus
:
1
,
commentLevel1Status
:
1
type
:
COMMENTLEVEL1_TYPE
,
threadStatus
:
1
},{
type
:
COMMENTLEVEL2_TYPE
,
threadStatus
:
1
,
commentLevel1Status
:
1
,
commentLevel2Status
:
1
type
:
COMMENTLEVEL2_TYPE
,
threadStatus
:
1
,
commentLevel1Status
:
1
}]
};
...
...
@@ -418,10 +423,16 @@ exports.other2me=function(ent_code,id,pageNo,pageSize,callback){
var
condition
=
{
ent_code
:
ent_code
,
to
:
new
mongoose
.
Types
.
ObjectId
(
id
),
// $or:[{
// type:COMMENTLEVEL1_TYPE,threadStatus:1,commentLevel1Status:1
// },{
// type:COMMENTLEVEL2_TYPE,threadStatus:1,commentLevel1Status:1,commentLevel2Status:1
// }]
$or
:[{
type
:
COMMENTLEVEL1_TYPE
,
threadStatus
:
1
,
commentLevel1Status
:
1
type
:
COMMENTLEVEL1_TYPE
,
threadStatus
:
1
},{
type
:
COMMENTLEVEL2_TYPE
,
threadStatus
:
1
,
commentLevel1Status
:
1
,
commentLevel2Status
:
1
type
:
COMMENTLEVEL2_TYPE
,
threadStatus
:
1
,
commentLevel1Status
:
1
}]
};
ForumAboutMe
.
find
(
condition
).
count
(
function
(
err
,
count
){
...
...
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