Fix SQL group by and undefined function errors in admin APIs
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user