// 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