mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-25 21:32:51 +09:00
Improving do not count the deleted comments.
This commit is contained in:
parent
5e036bf586
commit
fb4ff53a6f
3 changed files with 26 additions and 1 deletions
|
|
@ -939,6 +939,24 @@ class commentController extends comment
|
|||
// call a trigger by delete (after)
|
||||
ModuleHandler::triggerCall('comment.updateCommentByDelete', 'after', $obj);
|
||||
|
||||
// update the number of comments
|
||||
$oCommentModel = getModel('comment');
|
||||
$comment_count = $oCommentModel->getCommentCount($obj->document_srl);
|
||||
// only document is exists
|
||||
if(isset($comment_count))
|
||||
{
|
||||
// create the controller object of the document
|
||||
$oDocumentController = getController('document');
|
||||
|
||||
// update comment count of the article posting
|
||||
$output = $oDocumentController->updateCommentCount($obj->document_srl, $comment_count, NULL, FALSE);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$output->add('document_srl', $obj->document_srl);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue