// Improve performance on specific price rule when editing a product
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17828 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
dbcffd2a3f
commit
c96ed6bb7b
1 file changed
+4
-5
@@ -182,11 +182,11 @@ class SpecificPriceRuleCore extends ObjectModel
|
|||||||
$categories = false;
|
$categories = false;
|
||||||
$features = false;
|
$features = false;
|
||||||
$suppliers = false;
|
$suppliers = false;
|
||||||
$where = false;
|
$where = '1';
|
||||||
|
|
||||||
if ($conditions_group)
|
if ($conditions_group)
|
||||||
{
|
{
|
||||||
$where = '(';
|
$where .= ' AND (';
|
||||||
foreach ($conditions_group as $id_condition_group => $condition_group)
|
foreach ($conditions_group as $id_condition_group => $condition_group)
|
||||||
{
|
{
|
||||||
$fields = array(
|
$fields = array(
|
||||||
@@ -239,10 +239,9 @@ class SpecificPriceRuleCore extends ObjectModel
|
|||||||
$where = rtrim($where, ' AND ').') OR (';
|
$where = rtrim($where, ' AND ').') OR (';
|
||||||
}
|
}
|
||||||
$where = rtrim($where, '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)
|
if ($attributes)
|
||||||
{
|
{
|
||||||
$query->select('pa.id_product_attribute');
|
$query->select('pa.id_product_attribute');
|
||||||
|
|||||||
Reference in new issue
Block a user