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

This commit is contained in:
rMalie
2011-07-19 09:23:10 +00:00
parent 6551a3ece7
commit ff81f71449
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'];