Skip to content

Commit

Permalink
comment feedback
Browse files Browse the repository at this point in the history
comment feedback
  • Loading branch information
alikon committed Jul 23, 2016
1 parent 0b10e44 commit 6175ac8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions administrator/components/com_content/models/articles.php
Expand Up @@ -204,7 +204,7 @@ protected function getListQuery()

if (JPluginHelper::isEnabled('content', 'vote'))
{
$assogroup = 'a.id, l.title, l.image, uc.name, ag.title, c.title, ua.name, v.rating_sum, v.rating_count';
$assogroup .= ', v.rating_sum, v.rating_count';
$query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating,
COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count')
->join('LEFT', '#__content_rating AS v ON a.id = v.content_id');
Expand Down Expand Up @@ -326,10 +326,11 @@ protected function getListQuery()

if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderCol = empty($this->state->get('list.fullordering', 'a.id')) ? 'a.id' : $this->state->get('list.fullordering', 'a.id');
$orderCol = empty($this->state->get('list.fullordering', 'a.id')) ? 'a.id' : $this->state->get('list.fullordering', 'a.id');
$orderDirn = '';
}

$query->order($db->escape($orderCol));
$query->order($db->escape($orderCol) . ' '. $orderDirn);

return $query;
}
Expand Down

0 comments on commit 6175ac8

Please sign in to comment.