diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index 16a42116e..8fe1be370 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -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());