mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Clean up poll.admin.model.php #1539
This commit is contained in:
parent
072ccc5b63
commit
62d14f5abd
1 changed files with 15 additions and 24 deletions
|
|
@ -19,11 +19,7 @@ class pollAdminModel extends poll
|
|||
*/
|
||||
function getPollList($args)
|
||||
{
|
||||
$output = executeQueryArray('poll.getPollList', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
//if($output->data && !is_array($output->data)) $output->data = array($output->data);
|
||||
return $output;
|
||||
return executeQueryArray('poll.getPollList', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -31,10 +27,7 @@ class pollAdminModel extends poll
|
|||
*/
|
||||
function getPollListWithMember($args)
|
||||
{
|
||||
$output = executeQueryArray('poll.getPollListWithMember', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return $output;
|
||||
return executeQueryArray('poll.getPollListWithMember', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -42,28 +35,26 @@ class pollAdminModel extends poll
|
|||
*/
|
||||
function getPollAdminTarget()
|
||||
{
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
//$poll_srl = Context::get('poll_srl');
|
||||
$upload_target_srl = Context::get('upload_target_srl');
|
||||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oCommentModel = getModel('comment');
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($upload_target_srl);
|
||||
|
||||
if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl);
|
||||
|
||||
if($oComment && $oComment->isExists())
|
||||
{
|
||||
$this->add('document_srl', $oComment->get('document_srl'));
|
||||
$this->add('comment_srl', $oComment->get('comment_srl'));
|
||||
}
|
||||
elseif($oDocument->isExists())
|
||||
$oDocument = DocumentModel::getDocument($upload_target_srl);
|
||||
if ($oDocument->isExists())
|
||||
{
|
||||
$this->add('document_srl', $oDocument->get('document_srl'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setError('msg_not_founded');
|
||||
$oComment = CommentModel::getComment($upload_target_srl);
|
||||
if ($oComment->isExists())
|
||||
{
|
||||
$this->add('document_srl', $oComment->get('document_srl'));
|
||||
$this->add('comment_srl', $oComment->get('comment_srl'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setError('msg_not_founded');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue