diff --git a/backend/Admin/marketing/ai_price_prediction.php b/backend/Admin/marketing/ai_price_prediction.php index 8545d3af..4becfaac 100644 --- a/backend/Admin/marketing/ai_price_prediction.php +++ b/backend/Admin/marketing/ai_price_prediction.php @@ -13,7 +13,7 @@ if ($role !== 'admin' && $role !== 'super_admin') { } try { - $countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null); + $countryCode = filterRequest('country_code'); if (!$countryCode) { jsonError("Missing required parameter: country_code"); diff --git a/backend/Admin/marketing/get_campaigns_log.php b/backend/Admin/marketing/get_campaigns_log.php index c2da7ff0..3f13ee34 100644 --- a/backend/Admin/marketing/get_campaigns_log.php +++ b/backend/Admin/marketing/get_campaigns_log.php @@ -45,9 +45,11 @@ try { FROM marketing_campaigns_log"; if ($countryCode) { $sqlStats .= " WHERE country_code = :country"; + $sqlStats .= " GROUP BY message_type"; $stmtStats = $con->prepare($sqlStats); $stmtStats->execute([':country' => strtoupper($countryCode)]); } else { + $sqlStats .= " GROUP BY message_type"; $stmtStats = $con->prepare($sqlStats); $stmtStats->execute(); } diff --git a/backend/Admin/marketing/get_market_share_analytics.php b/backend/Admin/marketing/get_market_share_analytics.php index 8b09adb7..9a0ea37a 100644 --- a/backend/Admin/marketing/get_market_share_analytics.php +++ b/backend/Admin/marketing/get_market_share_analytics.php @@ -13,7 +13,7 @@ if ($role !== 'admin' && $role !== 'super_admin') { } try { - $countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null); + $countryCode = filterRequest('country_code'); if (!$countryCode) { jsonError("Missing required parameter: country_code"); diff --git a/backend/Admin/marketing/get_price_gap_heatmap.php b/backend/Admin/marketing/get_price_gap_heatmap.php index 13f87051..76057f86 100644 --- a/backend/Admin/marketing/get_price_gap_heatmap.php +++ b/backend/Admin/marketing/get_price_gap_heatmap.php @@ -13,7 +13,7 @@ if ($role !== 'admin' && $role !== 'super_admin') { } try { - $countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null); + $countryCode = filterRequest('country_code'); if (!$countryCode) { jsonError("Missing required parameter: country_code"); diff --git a/backend/Admin/marketing/what_if_simulator.php b/backend/Admin/marketing/what_if_simulator.php index 7c2c8c02..2e42d837 100644 --- a/backend/Admin/marketing/what_if_simulator.php +++ b/backend/Admin/marketing/what_if_simulator.php @@ -13,7 +13,7 @@ if ($role !== 'admin' && $role !== 'super_admin') { } try { - $countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null); + $countryCode = filterRequest('country_code'); $proposedSpeedPrice = (float)filterRequest('speed_price'); if (!$countryCode || $proposedSpeedPrice <= 0) { diff --git a/backend/Admin/marketing/winback_hotspot_targets.php b/backend/Admin/marketing/winback_hotspot_targets.php index 5cda153a..5575512d 100644 --- a/backend/Admin/marketing/winback_hotspot_targets.php +++ b/backend/Admin/marketing/winback_hotspot_targets.php @@ -14,7 +14,7 @@ if ($role !== 'admin' && $role !== 'super_admin') { } try { - $countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null); + $countryCode = filterRequest('country_code'); if (!$countryCode) { jsonError("Missing required parameter: country_code");