[-] MO : mailalert : Fix duplicate result
This commit is contained in:
@@ -212,12 +212,11 @@ class MailAlert extends ObjectModel
|
|||||||
$sql = '
|
$sql = '
|
||||||
SELECT ma.`id_product`, p.`quantity` AS product_quantity, pl.`name`, ma.`id_product_attribute`
|
SELECT ma.`id_product`, p.`quantity` AS product_quantity, pl.`name`, ma.`id_product_attribute`
|
||||||
FROM `'._DB_PREFIX_.self::$definition['table'].'` ma
|
FROM `'._DB_PREFIX_.self::$definition['table'].'` ma
|
||||||
JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = ma.`id_product`
|
JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = ma.`id_product`)
|
||||||
'.Shop::addSqlAssociation('product', 'p').'
|
'.Shop::addSqlAssociation('product', 'p').'
|
||||||
JOIN `'._DB_PREFIX_.'product_lang` pl ON pl.`id_product` = ma.`id_product`
|
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` AND pl.id_shop IN ('.implode(', ', Shop::getContextListShopID(false)).'))
|
||||||
WHERE product_shop.`active` = 1
|
WHERE product_shop.`active` = 1
|
||||||
AND (ma.`id_customer` = '.(int)$customer->id.'
|
AND (ma.`id_customer` = '.(int)$customer->id.' OR ma.`customer_email` = \''.pSQL($customer->email).'\')
|
||||||
OR ma.`customer_email` = \''.pSQL($customer->email).'\')
|
|
||||||
AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestriction(false, 'ma');
|
AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestriction(false, 'ma');
|
||||||
|
|
||||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||||
|
|||||||
Reference in New Issue
Block a user