// Fix Shop::SHARE_ORDER and Shop::SHARE_CUSTOMER on statistics
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7959 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -109,7 +109,7 @@ class StatsSales extends ModuleGraph
|
||||
FROM `'._DB_PREFIX_.'orders` o
|
||||
'.((int)Tools::getValue('id_country') ? 'LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_delivery = a.id_address' : '').'
|
||||
WHERE o.valid = 1
|
||||
'.$this->sqlShopRestriction(false, 'o').'
|
||||
'.$this->sqlShopRestriction(Shop::SHARE_ORDER, 'o').'
|
||||
'.((int)Tools::getValue('id_country') ? 'AND a.id_country = '.(int)Tools::getValue('id_country') : '').'
|
||||
AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween();
|
||||
$result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
|
||||
@@ -119,7 +119,7 @@ class StatsSales extends ModuleGraph
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON od.`id_order` = o.`id_order`
|
||||
'.((int)Tools::getValue('id_country') ? 'LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_delivery = a.id_address' : '').'
|
||||
WHERE o.valid = 1
|
||||
'.$this->sqlShopRestriction(false, 'o').'
|
||||
'.$this->sqlShopRestriction(Shop::SHARE_ORDER, 'o').'
|
||||
'.((int)Tools::getValue('id_country') ? 'AND a.id_country = '.(int)Tools::getValue('id_country') : '').'
|
||||
AND o.`invoice_date` BETWEEN '.ModuleGraph::getDateBetween();
|
||||
$result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
|
||||
@@ -158,7 +158,7 @@ class StatsSales extends ModuleGraph
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON od.`id_order` = o.`id_order`
|
||||
'.((int)($this->id_country) ? 'LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_delivery = a.id_address' : '').'
|
||||
WHERE o.valid = 1
|
||||
'.$this->sqlShopRestriction('o').'
|
||||
'.$this->sqlShopRestriction(Shop::SHARE_ORDER, 'o').'
|
||||
'.((int)($this->id_country) ? 'AND a.id_country = '.(int)$this->id_country : '').'
|
||||
AND o.`invoice_date` BETWEEN ';
|
||||
$this->_query2 = ' GROUP BY o.id_order';
|
||||
|
||||
Reference in New Issue
Block a user