mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Clean up return value juggling in getNewestCommentList()
This commit is contained in:
parent
26fd165337
commit
9247e602b5
1 changed files with 5 additions and 20 deletions
|
|
@ -451,36 +451,21 @@ class CommentModel extends Comment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = executeQuery('comment.getNewestCommentList', $args, $columnList);
|
$output = executeQueryArray('comment.getNewestCommentList', $args, $columnList);
|
||||||
|
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
$comment_list = $output->data;
|
$result = [];
|
||||||
if($comment_list)
|
foreach ($output->data as $key => $attribute)
|
||||||
{
|
{
|
||||||
if(!is_array($comment_list))
|
if ($attribute->comment_srl)
|
||||||
{
|
{
|
||||||
$comment_list = array($comment_list);
|
$oComment = new CommentItem();
|
||||||
}
|
|
||||||
|
|
||||||
$result = [];
|
|
||||||
foreach($comment_list as $key => $attribute)
|
|
||||||
{
|
|
||||||
if(!$attribute->comment_srl)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$oComment = NULL;
|
|
||||||
$oComment = new commentItem();
|
|
||||||
$oComment->setAttribute($attribute);
|
$oComment->setAttribute($attribute);
|
||||||
|
|
||||||
$result[$key] = $oComment;
|
$result[$key] = $oComment;
|
||||||
}
|
}
|
||||||
$output->data = $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue