// Replace shop->addSqlRestriction() and shop->addSqlRestrictionOnLang() by static versions

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13618 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-02-27 12:15:30 +00:00
parent 2caf013a0f
commit c2cef61a5a
58 changed files with 210 additions and 241 deletions
+3 -3
View File
@@ -97,7 +97,7 @@ class MailAlert extends ObjectModel
$customer = new Customer($id_customer);
$customer_email = $customer->email;
$products = MailAlert::getProducts($customer, $id_lang, $shop);
$products = MailAlert::getProducts($customer, $id_lang);
if ((empty($products) === true) || (!sizeof($products)))
return array();
@@ -195,7 +195,7 @@ class MailAlert extends ObjectModel
/*
* Get products according to alerts
*/
public static function getProducts($customer, $id_lang, Shop $shop)
public static function getProducts($customer, $id_lang)
{
$sql = 'SELECT ma.`id_product`, p.`quantity` AS product_quantity, pl.`name`, ma.`id_product_attribute`
FROM `'._DB_PREFIX_.self::$definition['table'].'` ma
@@ -204,7 +204,7 @@ class MailAlert extends ObjectModel
WHERE p.`active` = 1
AND (ma.`id_customer` = '.(int)$customer->id.'
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);
}