// Perfs and clean

This commit is contained in:
dMetzger
2012-08-14 14:10:11 +00:00
parent 507b365a56
commit 455f13e996
4 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -260,15 +260,15 @@ class HookCore extends ObjectModel
// For payment modules, we check that they are available in the contextual country
if (Validate::isLoadedObject($context->country))
$sql->where('(h.name != "displayPayment" OR (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' LIMIT 1) = '.(int)$context->country->id.')');
$sql->where('hm.id_shop IN('.implode(', ', $shop_list).')');
$sql->where('hm.id_shop IN ('.implode(', ', $shop_list).')');
if (isset($context->customer) && $context->customer->isLogged())
{
$sql->leftJoin('module_group', 'mg', 'mg.`id_module` = m.`id_module`');
$sql->where('mg.`id_group` IN('.implode(', ', $groups).')');
$sql->where('mg.`id_group` IN ('.implode(', ', $groups).')');
$sql->groupBy('hm.id_hook, hm.id_module');
}
$sql->groupBy('hm.id_hook, hm.id_module');
$sql->orderBy('hm.`position`');
// Store results per hook name
+1 -2
View File
@@ -1874,9 +1874,8 @@ class ProductCore extends ObjectModel
if (Combination::isFeatureActive())
{
$sql->select('pa.id_product_attribute');
$sql->leftOuterJoin('product_attribute', 'pa', 'p.`id_product` = pa.`id_product`');
$sql->leftOuterJoin('product_attribute', 'pa', 'p.`id_product` = pa.`id_product` AND pa.default_on = 1');
$sql->join(Shop::addSqlAssociation('product_attribute', 'pa', false));
$sql->where('(product_attribute_shop.default_on = 1 OR product_attribute_shop.default_on IS NULL)');
}
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
+1
View File
@@ -1870,6 +1870,7 @@ CREATE TABLE `PREFIX_tax_rule` (
PRIMARY KEY (`id_tax_rule`),
KEY `id_tax_rules_group` (`id_tax_rules_group`),
KEY `id_tax` (`id_tax`)
KEY `category_getproducts` ( `id_tax_rules_group` , `id_country` , `id_state` , `zipcode_from` )
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
CREATE TABLE `PREFIX_tax_rules_group` (
+2
View File
@@ -11,3 +11,5 @@ DELETE FROM `PREFIX_tab_lang` WHERE `id_tab` NOT IN (SELECT `id_tab` FROM `PREFI
DELETE FROM `PREFIX_access` WHERE `id_tab` NOT IN (SELECT `id_tab` FROM `PREFIX_tab`);
UPDATE `PREFIX_employee` SET bo_theme = 'default';
ALTER TABLE `PREFIX_tax_rule` ADD INDEX `category_getproducts` ( `id_tax_rules_group` , `id_country` , `id_state` , `zipcode_from` )