[-] BO: Improve memory usage in admin product in global context with a lot of shops and attributes

This commit is contained in:
Rémi Gaillard
2012-12-11 16:05:29 +01:00
parent 5698e05f63
commit ef4b3576fc
+1 -2
View File
@@ -47,7 +47,6 @@ class AttributeCore extends ObjectModel
'color' => array('type' => self::TYPE_STRING, 'validate' => 'isColor'),
'position' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
// Lang fields
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
)
);
@@ -130,7 +129,7 @@ class AttributeCore extends ObjectModel
return array();
return Db::getInstance()->executeS('
SELECT ag.*, agl.*, a.`id_attribute`, al.`name`, agl.`name` AS `attribute_group`
SELECT DISTINCT ag.*, agl.*, a.`id_attribute`, al.`name`, agl.`name` AS `attribute_group`
FROM `'._DB_PREFIX_.'attribute_group` ag
LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl
ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.')