Merge pull request #578 from abhishek-webkul/gli-1244

Fix Customers KPI on Customers page
This commit is contained in:
Rohit Jain
2023-03-07 17:48:33 +05:30
committed by GitHub

View File

@@ -354,7 +354,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
public static function getCustomerMainGender()
{
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT SUM(IF(g.id_gender IS NOT NULL, 1, 0)) as total, SUM(IF(type = 0, 1, 0)) as male, SUM(IF(type = 1, 1, 0)) as female, SUM(IF(type = 2, 1, 0)) as neutral
SELECT SUM(IF(c.id_gender IS NOT NULL, 1, 0)) as total, SUM(IF(type = 0, 1, 0)) as male, SUM(IF(type = 1, 1, 0)) as female, SUM(IF(type = 2, 1, 0)) as neutral
FROM `'._DB_PREFIX_.'customer` c
LEFT JOIN `'._DB_PREFIX_.'gender` g ON c.id_gender = g.id_gender
WHERE c.active = 1 '.Shop::addSqlRestriction());