Fix SQL group by and undefined function errors in admin APIs

This commit is contained in:
Hamza-Ayed
2026-06-30 21:17:06 +03:00
parent 1ae8acad7a
commit fdd09d8f35
6 changed files with 7 additions and 5 deletions

View File

@@ -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();
}