게시판 리스트에서 추천과 추천취소시 모듈정보를 가져오지 못하는 문제 고침

This commit is contained in:
BJRambo 2019-10-07 17:54:35 +09:00
parent 145f7e2c65
commit 8bdaad3e72

View file

@ -24,17 +24,26 @@ class documentController extends document
*/
function procDocumentVoteUp()
{
if($this->module_info->non_login_vote !== 'Y')
$document_srl = Context::get('target_srl');
if(!$document_srl)
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
$module_info = $this->module_info;
if(!$module_info->module_srl)
{
$module_info = getModel('module')->getModuleInfoByDocumentSrl($document_srl);
}
if($module_info->non_login_vote !== 'Y')
{
if(!Context::get('is_logged'))
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
}
$document_srl = Context::get('target_srl');
if(!$document_srl) throw new Rhymix\Framework\Exceptions\InvalidRequest;
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
$module_srl = $oDocument->get('module_srl');
@ -56,7 +65,19 @@ class documentController extends document
function procDocumentVoteUpCancel()
{
if($this->module_info->non_login_vote !== 'Y')
$document_srl = Context::get('target_srl');
if(!$document_srl)
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
$module_info = $this->module_info;
if(!$module_info->module_srl)
{
$module_info = getModel('module')->getModuleInfoByDocumentSrl($document_srl);
}
if($module_info->non_login_vote !== 'Y')
{
if(!Context::get('is_logged'))
{
@ -64,16 +85,10 @@ class documentController extends document
}
}
if($this->module_info->cancel_vote !== 'Y')
if($module_info->cancel_vote !== 'Y')
{
throw new Rhymix\Framework\Exception('failed_voted_cancel');
}
$document_srl = Context::get('target_srl');
if(!$document_srl)
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);