// Remove bad _SQL_USE_SLAVE_ uses + normalize Db->executeS(), Db->execute() and Db->numRows() names
This commit is contained in:
@@ -154,7 +154,7 @@ class AdminAddressesControllerCore extends AdminController
|
||||
$address_type = ((int)(Tools::getValue('address_type')) == 2 ? 'invoice' : ((int)(Tools::getValue('address_type')) == 1 ? 'delivery' : ''));
|
||||
if (isset($_POST['submitAdd'.$this->table]) AND ($id_order = (int)(Tools::getValue('id_order'))) AND !sizeof($this->_errors) AND !empty($address_type))
|
||||
{
|
||||
if(!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'orders SET `id_address_'.$address_type.'` = '.Db::getInstance()->Insert_ID().' WHERE `id_order` = '.$id_order))
|
||||
if(!Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET `id_address_'.$address_type.'` = '.Db::getInstance()->Insert_ID().' WHERE `id_order` = '.$id_order))
|
||||
$this->_errors[] = Tools::displayError('An error occurred while linking this address to its order.');
|
||||
else
|
||||
Tools::redirectAdmin(Tools::getValue('back').'&conf=4');
|
||||
|
||||
@@ -315,7 +315,7 @@ class AdminHomeControllerCore extends AdminController
|
||||
<div id="stat_google">';
|
||||
|
||||
$chart = new Chart();
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT total_paid / conversion_rate as total_converted, invoice_date
|
||||
FROM '._DB_PREFIX_.'orders o
|
||||
WHERE valid = 1
|
||||
|
||||
@@ -63,7 +63,7 @@ class AdminRequestSqlControllerCore extends AdminController
|
||||
if (!($obj = $this->loadObject(true)))
|
||||
return;
|
||||
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT `id_request_sql`
|
||||
FROM `'._DB_PREFIX_.'request_sql`
|
||||
');
|
||||
@@ -90,7 +90,7 @@ class AdminRequestSqlControllerCore extends AdminController
|
||||
|
||||
if ($sql)
|
||||
{
|
||||
$results = Db::getInstance()->ExecuteS($sql[0]['sql']);
|
||||
$results = Db::getInstance()->executeS($sql[0]['sql']);
|
||||
foreach (array_keys($results[0]) as $key)
|
||||
{
|
||||
$tab_key[] = $key;
|
||||
@@ -145,7 +145,7 @@ class AdminRequestSqlControllerCore extends AdminController
|
||||
|
||||
$view = array();
|
||||
|
||||
if ($results = Db::getInstance()->ExecuteS($obj->sql))
|
||||
if ($results = Db::getInstance()->executeS($obj->sql))
|
||||
{
|
||||
foreach (array_keys($results[0]) as $key)
|
||||
$tab_key[] = $key;
|
||||
|
||||
@@ -99,7 +99,7 @@ class AdminTrackingController extends AdminController
|
||||
$this->_list['message'] = $this->l('List of out of stock products with attributes:');
|
||||
break ;
|
||||
}
|
||||
$this->_list['obj'] = Db::getInstance()->ExecuteS($sql);
|
||||
$this->_list['obj'] = Db::getInstance()->executeS($sql);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class ContactControllerCore extends FrontController
|
||||
$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($from, (int)Tools::getValue('id_order'))
|
||||
)))
|
||||
{
|
||||
$fields = Db::getInstance()->ExecuteS('
|
||||
$fields = Db::getInstance()->executeS('
|
||||
SELECT cm.id_customer_thread, cm.id_contact, cm.id_customer, cm.id_order, cm.id_product, cm.email
|
||||
FROM '._DB_PREFIX_.'customer_thread cm
|
||||
WHERE email = \''.pSQL($from).'\' AND cm.id_shop = '.(int)$this->context->shop->getID(true).' AND ('.
|
||||
@@ -233,7 +233,7 @@ class ContactControllerCore extends FrontController
|
||||
|
||||
$products = array();
|
||||
$orders = array();
|
||||
$getOrders = Db::getInstance()->ExecuteS('
|
||||
$getOrders = Db::getInstance()->executeS('
|
||||
SELECT id_order
|
||||
FROM '._DB_PREFIX_.'orders
|
||||
WHERE id_customer = '.(int)$this->context->customer->id.' ORDER BY date_add');
|
||||
|
||||
@@ -89,7 +89,7 @@ class StoresControllerCore extends FrontController
|
||||
*/
|
||||
protected function assignStoresSimplified()
|
||||
{
|
||||
$stores = Db::getInstance()->ExecuteS('
|
||||
$stores = Db::getInstance()->executeS('
|
||||
SELECT s.*, cl.name country, st.iso_code state
|
||||
FROM '._DB_PREFIX_.'store s
|
||||
'.$this->context->shop->sqlAsso('shop', 's').'
|
||||
@@ -115,7 +115,7 @@ class StoresControllerCore extends FrontController
|
||||
|
||||
if (Tools::getValue('all') == 1)
|
||||
{
|
||||
$stores = Db::getInstance()->ExecuteS('
|
||||
$stores = Db::getInstance()->executeS('
|
||||
SELECT s.*, cl.name country, st.iso_code state
|
||||
FROM '._DB_PREFIX_.'store s
|
||||
'.$this->context->shop->sqlAsso('shop', 's').'
|
||||
@@ -128,7 +128,7 @@ class StoresControllerCore extends FrontController
|
||||
$distance = (int)(Tools::getValue('radius', 100));
|
||||
$multiplicator = ($distanceUnit == 'km' ? 6371 : 3959);
|
||||
|
||||
$stores = Db::getInstance()->ExecuteS('
|
||||
$stores = Db::getInstance()->executeS('
|
||||
SELECT s.*, cl.name country, st.iso_code state,
|
||||
('.(int)($multiplicator).'
|
||||
* acos(
|
||||
|
||||
Reference in New Issue
Block a user