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
3f5ad0b3
Commit
3f5ad0b3
authored
Apr 23, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
feffc644
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
22 deletions
+13
-22
forumThread.js
app/controllers/admin/forumThread.js
+13
-22
No files found.
app/controllers/admin/forumThread.js
View file @
3f5ad0b3
...
...
@@ -81,9 +81,7 @@ router.post('/thread/create', function(req, res, next) {
}
});
}
});
}
}
});
}
}
});
});
...
...
@@ -357,28 +355,21 @@ router.post('/thread/comment/update/:cid/comments', function(req, res, next) {
var
cid
=
req
.
params
.
cid
||
null
;
var
replayComment_id
=
req
.
body
.
replayComment_id
;
// 获取评论的子评论列表
forumCommentService
.
getCommentById
(
cid
,
function
(
err
,
result
)
{
// 更新文章评论 + 1
forumThreadService
.
updateThreadCommentCountInc
(
tid
,
function
(
err
,
thread
)
{
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
}
});
// 更新评论对象
// result.comment_count+=1; // 回复评论+1
forumCommentService
.
updateCommentById
(
cid
,
{
$push
:{
comments
:
replayComment_id
},
$inc
:{
comment_count
:
1
}},
function
(
err
,
result
)
{
if
(
err
)
{
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
// 更新文章评论 + 1
forumThreadService
.
updateThreadCommentCountInc
(
tid
,
function
(
err
,
thread
)
{
if
(
err
)
{
callback
(
err
,
null
);
}
});
// 更新评论对象
result
.
comments
.
push
(
replayComment_id
);
// 添加子评论ID
// result.comment_count+=1; // 回复评论+1
forumCommentService
.
updateCommentById
(
cid
,
result
,
function
(
err
,
result
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
}
else
{
res
.
json
(
returnCode
.
SUCCESS
);
}
});
res
.
json
(
returnCode
.
SUCCESS
);
}
});
});
...
...
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