// Context in modules + Shop::sql* methods

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7648 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-07-19 09:23:10 +00:00
parent 2c493137c3
commit 8a0a62ae03
25 changed files with 127 additions and 263 deletions
+1 -9
View File
@@ -147,15 +147,7 @@ class StatsCatalog extends Module
$this->_join = ' LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)';
$this->_where = ' AND cp.`id_category` = '.$id_category;
}
if ($this->shopID || $this->shopGroupID)
{
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'product_shop ps ON ps.id_product = p.id_product';
if ($this->shopID)
$this->_where .= ' AND ps.id_shop = ' . $this->shopID;
else if ($this->shopGroupID)
$this->_where .= ' AND ps.id_shop IN (SELECT id_shop FROM '._DB_PREFIX_.'shop WHERE id_group_shop = '.$this->shopGroupID.')';
}
$this->_join .= Shop::sqlAsso('product', 'p', true, $this->context);
$result1 = $this->getQuery1(true);
$total = $result1['total'];