Fix unnecessary query when there are no polls

This commit is contained in:
Kijin Sung 2020-05-18 19:12:06 +09:00
parent cd58305fc1
commit 3430e21be4
3 changed files with 16 additions and 3 deletions

View file

@ -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