mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Fix unnecessary query when there are no polls
This commit is contained in:
parent
cd58305fc1
commit
3430e21be4
3 changed files with 16 additions and 3 deletions
|
|
@ -176,9 +176,13 @@ class commentModel extends comment
|
|||
*/
|
||||
function getComments($comment_srl_list, $columnList = array())
|
||||
{
|
||||
if(is_array($comment_srl_list))
|
||||
if (!is_array($comment_srl_list))
|
||||
{
|
||||
$comment_srls = implode(',', $comment_srl_list);
|
||||
$comment_srl_list = $comment_srl_list ? explode(',', $comment_srl_list) : array();
|
||||
}
|
||||
if (!count($comment_srl_list))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
// fetch from a database
|
||||
|
|
|
|||
|
|
@ -187,6 +187,15 @@ class documentModel extends document
|
|||
*/
|
||||
function getDocuments($document_srls, $is_admin = false, $load_extra_vars = true, $columnList = array())
|
||||
{
|
||||
if (!is_array($document_srls))
|
||||
{
|
||||
$document_srls = $document_srls ? explode(',', $document_srls) : array();
|
||||
}
|
||||
if (!count($document_srls))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->document_srls = $document_srls;
|
||||
$args->list_count = is_array($document_srls) ? count($document_srls) : 1;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class pollAdminView extends poll
|
|||
$output = $oPollAdminModel->getPollListWithMember($args);
|
||||
|
||||
// check poll type. document or comment
|
||||
if(is_array($output->data))
|
||||
if(is_array($output->data) && count($output->data))
|
||||
{
|
||||
$uploadTargetSrlList = array();
|
||||
foreach($output->data as $value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue