// Improve performance on specific price rule when editing a product

This commit is contained in:
rGaillard
2012-10-10 16:49:51 +00:00
parent 03cf36aab2
commit 7842750f4e
+4 -5
View File
@@ -182,11 +182,11 @@ class SpecificPriceRuleCore extends ObjectModel
$categories = false;
$features = false;
$suppliers = false;
$where = false;
$where = '1';
if ($conditions_group)
{
$where = '(';
$where .= ' AND (';
foreach ($conditions_group as $id_condition_group => $condition_group)
{
$fields = array(
@@ -239,10 +239,9 @@ class SpecificPriceRuleCore extends ObjectModel
$where = rtrim($where, ' AND ').') OR (';
}
$where = rtrim($where, 'OR (');
if ($products && count($products))
$where .= ' AND p.id_product IN ('.implode(', ', array_map('intval', $products)).')';
}
if ($products && count($products))
$where .= ' AND p.id_product IN ('.implode(', ', array_map('intval', $products)).')';
if ($attributes)
{
$query->select('pa.id_product_attribute');