// 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:
rMalie
2011-08-09 13:42:03 +00:00
parent a86e95fc5a
commit bdc18d1d39
12 changed files with 53 additions and 53 deletions
+3 -3
View File
@@ -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';