// Remove bad _SQL_USE_SLAVE_ uses + normalize Db->executeS(), Db->execute() and Db->numRows() names
This commit is contained in:
@@ -169,7 +169,7 @@ class LoyaltyModule extends ObjectModel
|
||||
$query .= ' GROUP BY f.id_loyalty '.
|
||||
($pagination ? 'LIMIT '.(((int)($page) - 1) * (int)($nb)).', '.(int)($nb) : '');
|
||||
|
||||
return Db::getInstance()->ExecuteS($query);
|
||||
return Db::getInstance()->executeS($query);
|
||||
}
|
||||
|
||||
public static function getDiscountByIdCustomer($id_customer, $last=false)
|
||||
@@ -185,7 +185,7 @@ class LoyaltyModule extends ObjectModel
|
||||
$query.= ' ORDER BY f.id_loyalty DESC LIMIT 0,1';
|
||||
$query.= ' GROUP BY f.id_discount';
|
||||
|
||||
return Db::getInstance()->ExecuteS($query);
|
||||
return Db::getInstance()->executeS($query);
|
||||
}
|
||||
|
||||
public static function registerDiscount($discount)
|
||||
@@ -211,7 +211,7 @@ class LoyaltyModule extends ObjectModel
|
||||
|
||||
public static function getOrdersByIdDiscount($id_discount)
|
||||
{
|
||||
$items = Db::getInstance()->ExecuteS('
|
||||
$items = Db::getInstance()->executeS('
|
||||
SELECT f.id_order AS id_order, f.points AS points, f.date_upd AS date
|
||||
FROM `'._DB_PREFIX_.'loyalty` f
|
||||
WHERE f.id_discount = '.(int)($id_discount).' AND f.id_loyalty_state = '.(int)(LoyaltyStateModule::getConvertId()));
|
||||
@@ -235,7 +235,7 @@ class LoyaltyModule extends ObjectModel
|
||||
/* Register all transaction in a specific history table */
|
||||
private function historize()
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'loyalty_history` (`id_loyalty`, `id_loyalty_state`, `points`, `date_add`)
|
||||
VALUES ('.(int)($this->id).', '.(int)($this->id_loyalty_state).', '.(int)($this->points).', NOW())');
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ class Loyalty extends Module
|
||||
|
||||
function installDB()
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE `'._DB_PREFIX_.'loyalty` (
|
||||
`id_loyalty` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_loyalty_state` INT UNSIGNED NOT NULL DEFAULT 1,
|
||||
@@ -115,7 +115,7 @@ class Loyalty extends Module
|
||||
INDEX index_loyalty_customer (`id_customer`)
|
||||
) DEFAULT CHARSET=utf8 ;');
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE `'._DB_PREFIX_.'loyalty_history` (
|
||||
`id_loyalty_history` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_loyalty` INT UNSIGNED DEFAULT NULL,
|
||||
@@ -127,7 +127,7 @@ class Loyalty extends Module
|
||||
INDEX `index_loyalty_history_loyalty_state` (`id_loyalty_state`)
|
||||
) DEFAULT CHARSET=utf8 ;');
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE `'._DB_PREFIX_.'loyalty_state` (
|
||||
`id_loyalty_state` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_order_state` INT UNSIGNED DEFAULT NULL,
|
||||
@@ -135,7 +135,7 @@ class Loyalty extends Module
|
||||
INDEX index_loyalty_state_order_state (`id_order_state`)
|
||||
) DEFAULT CHARSET=utf8 ;');
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE `'._DB_PREFIX_.'loyalty_state_lang` (
|
||||
`id_loyalty_state` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_lang` INT UNSIGNED NOT NULL,
|
||||
@@ -157,10 +157,10 @@ class Loyalty extends Module
|
||||
|
||||
function uninstallDB()
|
||||
{
|
||||
Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'loyalty`;');
|
||||
Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'loyalty_state`;');
|
||||
Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'loyalty_state_lang`;');
|
||||
Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'loyalty_history`;');
|
||||
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'loyalty`;');
|
||||
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'loyalty_state`;');
|
||||
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'loyalty_state_lang`;');
|
||||
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'loyalty_history`;');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user