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
2f157241
Commit
2f157241
authored
May 16, 2016
by
刘文胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量 逻辑删除/屏蔽帖子
parent
9120e07a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
forumThreadManagement.js
app/controllers/admin/forumThreadManagement.js
+31
-1
forumThreadService.js
app/service/forumThreadService.js
+13
-0
No files found.
app/controllers/admin/forumThreadManagement.js
View file @
2f157241
...
...
@@ -376,4 +376,34 @@ router.get('/threadManagement/threads/statistics', function(req, res, next) {
},
returnCode
.
SUCCESS
));
});
});
\ No newline at end of file
});
//批量屏蔽帖子
router
.
post
(
'/threadManagement/threads/batchclose'
,
function
(
req
,
res
,
next
)
{
var
ent_code
=
req
.
session
.
user
.
ent_code
;
var
ids
=
req
.
body
.
ids
;
if
(
!
ent_code
||
!
ids
){
return
res
.
json
(
returnCode
.
BUSY
);
}
forumThreadService
.
batchClose
(
ent_code
,
ids
,
function
(
err
,
result
){
if
(
err
){
return
res
.
json
(
returnCode
.
BUSY
);
}
return
res
.
json
(
_
.
assign
({
data
:
true
},
returnCode
.
SUCCESS
));
});
});
//批量删除帖子
router
.
post
(
'/threadManagement/threads/batchdel'
,
function
(
req
,
res
,
next
)
{
var
ent_code
=
req
.
session
.
user
.
ent_code
;
var
ids
=
req
.
body
.
ids
;
if
(
!
ent_code
||
!
ids
){
return
res
.
json
(
returnCode
.
BUSY
);
}
forumThreadService
.
batchLogicDelete
(
ent_code
,
ids
,
function
(
err
,
result
){
if
(
err
){
return
res
.
json
(
returnCode
.
BUSY
);
}
return
res
.
json
(
_
.
assign
({
data
:
true
},
returnCode
.
SUCCESS
));
});
});
app/service/forumThreadService.js
View file @
2f157241
...
...
@@ -1140,6 +1140,19 @@ exports.updateThreadRaiseCount = function(threadId, callback) {
});
};
//批量屏蔽帖子
exports
.
batchClose
=
function
(
ent_code
,
ids
,
callback
)
{
update
({
ent_code
:
ent_code
,
_id
:
{
$in
:
ids
}},
{
$set
:{
status
:
0
}},
{
multi
:
true
},
'updateRedisRecommentThreads'
,
function
(
err
,
result
)
{
callback
(
err
,
!!!
err
);
});
};
//批量删除
exports
.
batchLogicDelete
=
function
(
ent_code
,
ids
,
callback
)
{
update
({
ent_code
:
ent_code
,
_id
:
{
$in
:
ids
}},
{
$set
:{
status
:
3
}},
{
multi
:
true
},
'updateRedisRecommentThreads'
,
function
(
err
,
result
)
{
callback
(
err
,
!!!
err
);
});
};
//减少文章点赞数
exports
.
updateThreadRaiseCountDec
=
function
(
threadId
,
callback
)
{
// ForumThread.update({
...
...
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