Skip to content

Commit 665a9e4

Browse files
authored
Fixed tag aggregation indexer query (#2858)
1 parent a1605eb commit 665a9e4

File tree

1 file changed

+4
-3
lines changed
  • app/code/core/Mage/Tag/Model/Resource/Indexer

1 file changed

+4
-3
lines changed

app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,14 @@ public function aggregate($tagIds = null)
154154
'tr.store_id',
155155
'customers' => 'COUNT(DISTINCT tr.customer_id)',
156156
'products' => 'COUNT(DISTINCT tr.product_id)',
157-
'popularity' => 'COUNT(tr.customer_id) + MIN('
157+
'popularity' => new Zend_Db_Expr(
158+
'COUNT(tr.customer_id) + MIN('
158159
. $writeAdapter->getCheckSql(
159160
'tp.base_popularity IS NOT NULL',
160161
'tp.base_popularity',
161162
'0'
162-
)
163-
. ')',
163+
) . ')'
164+
),
164165
'uses' => new Zend_Db_Expr(0), // deprecated since 1.4.0.1
165166
'historical_uses' => new Zend_Db_Expr(0), // deprecated since 1.4.0.1
166167
'base_popularity' => new Zend_Db_Expr(0) // deprecated since 1.4.0.1

0 commit comments

Comments
 (0)