mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 09:32:15 +09:00
#1973 보완 - 코드 정리
This commit is contained in:
parent
07cfb9f92e
commit
f81f7f565d
1 changed files with 15 additions and 4 deletions
|
|
@ -190,6 +190,7 @@ class commentAdminController extends comment
|
||||||
}
|
}
|
||||||
|
|
||||||
$oCommentController = getController('comment');
|
$oCommentController = getController('comment');
|
||||||
|
|
||||||
// begin transaction
|
// begin transaction
|
||||||
$oDB = DB::getInstance();
|
$oDB = DB::getInstance();
|
||||||
$oDB->begin();
|
$oDB->begin();
|
||||||
|
|
@ -213,6 +214,8 @@ class commentAdminController extends comment
|
||||||
}
|
}
|
||||||
|
|
||||||
$deleted_count = 0;
|
$deleted_count = 0;
|
||||||
|
$module_infos = [];
|
||||||
|
|
||||||
// Delete the comment posting
|
// Delete the comment posting
|
||||||
for($i = 0; $i < $comment_count; $i++)
|
for($i = 0; $i < $comment_count; $i++)
|
||||||
{
|
{
|
||||||
|
|
@ -223,9 +226,18 @@ class commentAdminController extends comment
|
||||||
}
|
}
|
||||||
|
|
||||||
$comment = CommentModel::getComment($comment_srl);
|
$comment = CommentModel::getComment($comment_srl);
|
||||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($comment->get('module_srl'));
|
if(!$comment->isExists())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if($module_info->comment_delete_message === 'yes')
|
$module_srl = $comment->get('module_srl');
|
||||||
|
if (!isset($module_infos[$module_srl]))
|
||||||
|
{
|
||||||
|
$module_infos[$module_srl] = ModuleModel::getModuleInfoByModuleSrl($module_srl)->comment_delete_message ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if($module_infos[$module_srl] === 'yes')
|
||||||
{
|
{
|
||||||
$output = $oCommentController->updateCommentByDelete($comment, true);
|
$output = $oCommentController->updateCommentByDelete($comment, true);
|
||||||
if(!$output->toBool() && $output->error !== -2)
|
if(!$output->toBool() && $output->error !== -2)
|
||||||
|
|
@ -234,10 +246,9 @@ class commentAdminController extends comment
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif(starts_with('only_comm', $module_info->comment_delete_message))
|
elseif(starts_with('only_comm', $module_infos[$module_srl]))
|
||||||
{
|
{
|
||||||
$childs = CommentModel::getChildComments($comment_srl);
|
$childs = CommentModel::getChildComments($comment_srl);
|
||||||
|
|
||||||
if(count($childs) > 0)
|
if(count($childs) > 0)
|
||||||
{
|
{
|
||||||
$output = $oCommentController->updateCommentByDelete($comment, true);
|
$output = $oCommentController->updateCommentByDelete($comment, true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue