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
0c25731d
Commit
0c25731d
authored
May 17, 2016
by
刘文胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/newfunc_0510_forum_management' into SANDBOX
parents
4c5514d2
e930587b
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
951 additions
and
4 deletions
+951
-4
forumThreadManagement.js
app/controllers/admin/forumThreadManagement.js
+691
-0
forumShare.js
app/controllers/mobile/forumShare.js
+228
-2
forumThread.js
app/models/forumThread.js
+5
-2
forumThreadService.js
app/service/forumThreadService.js
+27
-0
No files found.
app/controllers/admin/forumThreadManagement.js
0 → 100644
View file @
0c25731d
This diff is collapsed.
Click to expand it.
app/controllers/mobile/forumShare.js
View file @
0c25731d
This diff is collapsed.
Click to expand it.
app/models/forumThread.js
View file @
0c25731d
...
...
@@ -78,8 +78,11 @@ var ForumThreadSchema = new Schema({
comments
:
[{
type
:
Schema
.
Types
.
ObjectId
,
ref
:
'ForumComment'
}],
//评论内容列表
images
:
{
//文章图片列表
type
:
Array
},
share
:
{
//自定义分享
},
share_pic
:{
//帖子分享图标
type
:
String
},
share
:
{
//自定义分享(已弃用,后台管理没有设置的页面了)
type
:
Schema
.
Types
.
ObjectId
,
ref
:
'ForumShare'
},
...
...
app/service/forumThreadService.js
View file @
0c25731d
...
...
@@ -6,6 +6,7 @@ var ForumShare = mongoose.model('ForumShare');
var
forumUserService
=
require
(
'./forumUserService'
);
var
forumCommentService
=
require
(
'./forumCommentService'
);
var
forumAboutMEService
=
require
(
'./forumAboutMEService'
);
var
async
=
require
(
'async'
);
var
then
=
require
(
'thenjs'
);
...
...
@@ -1140,6 +1141,32 @@ exports.updateThreadRaiseCount = function(threadId, callback) {
});
};
//批量屏蔽帖子
exports
.
batchClose
=
function
(
ent_code
,
ids
,
callback
)
{
var
status_closed
=
0
;
update
({
ent_code
:
ent_code
,
_id
:
{
$in
:
ids
}},
{
status
:
status_closed
},
{
multi
:
true
},
'updateRedisRecommentThreads'
,
function
(
err
,
result
)
{
callback
(
err
,
!!!
err
);
if
(
!
err
){
_
.
forEach
(
ids
,
function
(
id
){
forumAboutMEService
.
updateThreadStatus
(
id
,
status_closed
);
});
}
});
};
//批量删除
exports
.
batchLogicDelete
=
function
(
ent_code
,
ids
,
callback
)
{
var
status_deleted
=
3
;
update
({
ent_code
:
ent_code
,
_id
:
{
$in
:
ids
}},
{
status
:
status_deleted
},
{
multi
:
true
},
'updateRedisRecommentThreads'
,
function
(
err
,
result
)
{
callback
(
err
,
!!!
err
);
if
(
!
err
){
_
.
forEach
(
ids
,
function
(
id
){
forumAboutMEService
.
updateThreadStatus
(
id
,
status_deleted
);
});
}
});
};
//减少文章点赞数
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