// More stats
This commit is contained in:
@@ -137,6 +137,32 @@ class Dashactivity extends Module
|
|||||||
FROM `'._DB_PREFIX_.'customer`
|
FROM `'._DB_PREFIX_.'customer`
|
||||||
WHERE `date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
|
WHERE `date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
|
||||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
||||||
|
|
||||||
|
$new_registrations = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM `'._DB_PREFIX_.'customer`
|
||||||
|
WHERE `newsletter_date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
|
||||||
|
AND newsletter = 1
|
||||||
|
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
||||||
|
$total_suscribers = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM `'._DB_PREFIX_.'customer`
|
||||||
|
WHERE newsletter = 1
|
||||||
|
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
||||||
|
if (Module::isInstalled('blocknewsletter'))
|
||||||
|
{
|
||||||
|
$new_registrations += Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM `'._DB_PREFIX_.'newsletter`
|
||||||
|
WHERE active = 1
|
||||||
|
AND `newsletter_date_add` BETWEEN "'.pSQL($params['date_from']).'" AND "'.pSQL($params['date_to']).'"
|
||||||
|
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
||||||
|
$total_suscribers += Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM `'._DB_PREFIX_.'newsletter`
|
||||||
|
WHERE active = 1
|
||||||
|
'.Shop::addSqlRestriction(Shop::SHARE_ORDER));
|
||||||
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'data_value' => array(
|
'data_value' => array(
|
||||||
@@ -151,8 +177,8 @@ class Dashactivity extends Module
|
|||||||
'new_customers' => $new_customers,
|
'new_customers' => $new_customers,
|
||||||
'online_visitor' => $online_visitor,
|
'online_visitor' => $online_visitor,
|
||||||
'active_shopping_cart' => $active_shopping_cart,
|
'active_shopping_cart' => $active_shopping_cart,
|
||||||
'new_registrations' => 42,
|
'new_registrations' => $new_registrations,
|
||||||
'total_suscribers' => 42,
|
'total_suscribers' => $total_suscribers,
|
||||||
'visits' => $visits,
|
'visits' => $visits,
|
||||||
'unique_visitors' => $unique_visitors,
|
'unique_visitors' => $unique_visitors,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class Dashtrends extends Module
|
|||||||
'orders_score' => $orders_score,
|
'orders_score' => $orders_score,
|
||||||
'cart_value_score' => Tools::displayPrice($orders_score ? $sales_score / $orders_score : 0),
|
'cart_value_score' => Tools::displayPrice($orders_score ? $sales_score / $orders_score : 0),
|
||||||
'visits_score' => $visits_score,
|
'visits_score' => $visits_score,
|
||||||
'convertion_rate_score' => $visits_score ? 100 * $orders_score / $visits_score : 0,
|
'convertion_rate_score' => $visits_score ? round(100 * $orders_score / $visits_score, 2) : 0,
|
||||||
'net_profits_score' => Tools::displayPrice(0),
|
'net_profits_score' => Tools::displayPrice(0),
|
||||||
),
|
),
|
||||||
'data_trends' => array(
|
'data_trends' => array(
|
||||||
|
|||||||
Reference in New Issue
Block a user