Skip to content

Commit

Permalink
Fix table name retrieval to handle potential table prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
romainruaud committed Mar 13, 2018
1 parent 4cc038b commit 321c1bf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public function loadRatingData($storeId, $productIds)
{
$select = $this->getConnection()->select()
->from(
$this->getTable('review_entity_summary'),
['res' => $this->getTable('review_entity_summary')],
[
'entity_pk_value as product_id',
'avg(rating_summary) as ratings_summary',
]
)
->where('review_entity_summary.store_id = ?', $storeId)
->where('review_entity_summary.entity_pk_value IN(?)', $productIds)
->where('res.store_id = ?', $storeId)
->where('res.entity_pk_value IN(?)', $productIds)
->group('entity_pk_value');

return $this->getConnection()->fetchAll($select);
Expand Down

0 comments on commit 321c1bf

Please sign in to comment.