Remove unnecessary table joins
This commit is contained in:
@@ -61,17 +61,12 @@ class AdminOrdersControllerCore extends AdminController
|
||||
a.id_currency,
|
||||
a.id_order AS id_pdf,
|
||||
CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`,
|
||||
osl.`name` AS `osname`,
|
||||
os.`color`,
|
||||
osl.`name` AS `osname`, os.`color`,
|
||||
IF((SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, 0, 1) as new,
|
||||
country_lang.name as cname,
|
||||
IF(a.valid, 1, 0) badge_success';
|
||||
|
||||
$this->_join = '
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`)
|
||||
INNER JOIN `'._DB_PREFIX_.'address` address ON address.id_address = a.id_address_delivery
|
||||
INNER JOIN `'._DB_PREFIX_.'country` country ON address.id_country = country.id_country
|
||||
INNER JOIN `'._DB_PREFIX_.'country_lang` country_lang ON (country.`id_country` = country_lang.`id_country` AND country_lang.`id_lang` = '.(int) $this->context->language->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int) $this->context->language->id.')';
|
||||
$this->_orderBy = 'id_order';
|
||||
@@ -3476,4 +3471,4 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user