From 34a247af0fda8be352d8d8f83f3a83c4f779ce9d Mon Sep 17 00:00:00 2001 From: dMetzger Date: Sat, 19 May 2012 09:59:54 +0000 Subject: [PATCH] // SQL query optimization --- classes/module/Module.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/module/Module.php b/classes/module/Module.php index 84aa206bc..af8430c6e 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -1254,8 +1254,9 @@ abstract class ModuleCore FROM `'._DB_PREFIX_.'module_country` mc LEFT JOIN `'._DB_PREFIX_.'module` m ON m.`id_module` = mc.`id_module` INNER JOIN `'._DB_PREFIX_.'module_group` mg ON (m.`id_module` = mg.`id_module`) - INNER JOIN `'._DB_PREFIX_.'customer_group` cg on (cg.`id_group` = mg.`id_group` - '.(isset($context->customer) ? 'AND cg.`id_customer` = '.(int)$context->customer->id : '').') + '.(isset($context->customer) + ? 'INNER JOIN `'._DB_PREFIX_.'customer_group` cg on (cg.`id_group` = mg.`id_group`AND cg.`id_customer` = '.(int)$context->customer->id.')' + : '').' LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module` LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook` WHERE h.`name` = \''.pSQL($hookPayment).'\'