//Fix Stats bug
This commit is contained in:
1 parent
759a3e191a
commit
299d1f65ec
1 file changed
+5
-5
@@ -193,7 +193,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
|||||||
SELECT COUNT(DISTINCT cp.id_category)
|
SELECT COUNT(DISTINCT cp.id_category)
|
||||||
FROM `'._DB_PREFIX_.'category` c
|
FROM `'._DB_PREFIX_.'category` c
|
||||||
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON c.id_category = cp.id_category
|
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON c.id_category = cp.id_category
|
||||||
'.Shop::addSqlAssociation('category', 'cp').'
|
'.Shop::addSqlAssociation('category', 'c').'
|
||||||
AND c.active = 1
|
AND c.active = 1
|
||||||
AND c.nright = c.nleft + 1');
|
AND c.nright = c.nleft + 1');
|
||||||
return intval($total - $used);
|
return intval($total - $used);
|
||||||
@@ -464,15 +464,15 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
|||||||
case 'orders_per_customer':
|
case 'orders_per_customer':
|
||||||
$value = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
$value = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
FROM `'._DB_PREFIX_.'customer`
|
FROM `'._DB_PREFIX_.'customer` c
|
||||||
'.Shop::addSqlAssociation('customer').'
|
'.Shop::addSqlAssociation('customer', 'c').'
|
||||||
WHERE active = 1');
|
WHERE active = 1');
|
||||||
if ($value)
|
if ($value)
|
||||||
{
|
{
|
||||||
$orders = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
$orders = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
FROM `'._DB_PREFIX_.'orders`
|
FROM `'._DB_PREFIX_.'orders` o
|
||||||
'.Shop::addSqlAssociation('orders').'
|
'.Shop::addSqlAssociation('orders', 'o').'
|
||||||
WHERE valid = 1');
|
WHERE valid = 1');
|
||||||
$value = round($orders / $value, 2);
|
$value = round($orders / $value, 2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user