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
ff75322f
Commit
ff75322f
authored
Dec 11, 2015
by
chrysan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
屏蔽
parent
e3bfbbfd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
26 deletions
+41
-26
forumThread.js
app/controllers/mobile/forumThread.js
+41
-26
No files found.
app/controllers/mobile/forumThread.js
View file @
ff75322f
...
...
@@ -1711,36 +1711,51 @@ router.post('/thread/:tid/comment/:cid/disable', function(req, res, next) {
//更改评论状态为0(屏蔽)
router
.
post
(
'/thread/:tid/comment/:cid/slash'
,
function
(
req
,
res
,
next
)
{
var
user_id
=
user
.
getMobileUser
(
req
),
tid
=
req
.
params
.
tid
,
var
tid
=
req
.
params
.
tid
,
entCode
=
req
.
session
.
user
.
ent_code
,
id
=
user
.
getMobileUser
(
req
),
//user._id
cid
=
req
.
params
.
cid
;
if
(
tid
&&
cid
)
{
forumCommentService
.
getCommentById
(
cid
,
function
(
err
,
comment
)
{
if
(
comment
&&
user_id
)
{
if
(
comment
.
from
.
toString
()
==
user_id
.
toString
())
{
forumCommentService
.
changeStatus
(
cid
,
0
,
function
(
err
,
update
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
}
else
{
if
(
comment
&&
comment
.
level
==
1
)
{
forumAboutMEService
.
updateCommentLevel1Status
(
comment
.
_id
,
0
);
}
// if (comment && comment.level == 2) {
// forumAboutMEService.updateCommentLevel2Status(comment._id, 2);
// }
res
.
json
(
returnCode
.
SUCCESS
);
}
});
var
q1
=
{};
//拼装查询条件
q1
.
ent_code
=
entCode
;
q1
.
_id
=
tid
;
q1
.
status
=
1
;
q1
.
$or
=
[{
recommend
:
0
},
{
recommend
:
null
}];
ForumThread
.
findOne
(
q1
).
populate
(
'from'
).
exec
(
function
(
err
,
t
)
{
if
(
err
||
!
t
)
{
return
res
.
json
(
returnCode
.
BUSY
);
}
if
(
!
t
.
info
){
//没有板块id直接返回
return
res
.
json
(
returnCode
.
BUSY
);
}
var
q2
=
{};
//查询当前用户是不是这篇文章的版主
q2
.
status
=
1
;
q2
.
ent_code
=
entCode
;
q2
.
forumUser
=
id
;
q2
.
infoIds
=
{
$all
:[
t
.
info
]};
ForumModeratorApply
.
findOne
(
q2
).
populate
(
'forumUser'
).
exec
(
function
(
err
,
result
){
if
(
err
){
return
res
.
json
(
returnCode
.
BUSY
);
}
if
(
!
result
){
//不是该版主
return
res
.
json
(
returnCode
.
ACTION_NOT_PERMISSION
);
}
//屏蔽
forumCommentService
.
changeStatus
(
cid
,
0
,
function
(
err
,
update
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
}
else
{
res
.
json
(
returnCode
.
ACTION_NOT_PERMISSION
);
if
(
comment
&&
comment
.
level
==
1
)
{
forumAboutMEService
.
updateCommentLevel1Status
(
comment
.
_id
,
0
);
}
res
.
json
(
returnCode
.
SUCCESS
);
}
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
});
});
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
});
});
//删除文章评论
...
...
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