// Replace shop->addSqlRestriction() and shop->addSqlRestrictionOnLang() by static versions
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13618 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -82,14 +82,14 @@ class StatsNewsletter extends ModuleGraph
|
||||
$sql = 'SELECT COUNT(*) as customers
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE 1
|
||||
'.$this->sqlShopRestriction(Shop::SHARE_CUSTOMER).'
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
|
||||
AND `newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween();
|
||||
$result1 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
|
||||
|
||||
$sql = 'SELECT COUNT(*) as visitors
|
||||
FROM '._DB_PREFIX_.'newsletter
|
||||
WHERE 1
|
||||
'.$this->sqlShopRestriction().'
|
||||
'.Shop::addSqlRestriction().'
|
||||
AND `newsletter_date_add` BETWEEN '.ModuleGraph::getDateBetween();
|
||||
$result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
|
||||
return array('customers' => $result1['customers'], 'visitors' => $result2['visitors'], 'both' => $result1['customers'] + $result2['visitors']);
|
||||
@@ -105,13 +105,13 @@ class StatsNewsletter extends ModuleGraph
|
||||
$this->_query = 'SELECT newsletter_date_add
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE 1
|
||||
'.$this->sqlShopRestriction(Shop::SHARE_CUSTOMER).'
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
|
||||
AND `newsletter_date_add` BETWEEN ';
|
||||
|
||||
$this->_query2 = 'SELECT newsletter_date_add
|
||||
FROM '._DB_PREFIX_.'newsletter
|
||||
WHERE 1
|
||||
'.$this->sqlShopRestriction(Shop::SHARE_CUSTOMER).'
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
|
||||
AND `newsletter_date_add` BETWEEN ';
|
||||
$this->setDateGraph($layers, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user