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 {
|
try {
|
||||||
$countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null);
|
$countryCode = filterRequest('country_code');
|
||||||
|
|
||||||
if (!$countryCode) {
|
if (!$countryCode) {
|
||||||
jsonError("Missing required parameter: country_code");
|
jsonError("Missing required parameter: country_code");
|
||||||
|
|||||||
@@ -45,9 +45,11 @@ try {
|
|||||||
FROM marketing_campaigns_log";
|
FROM marketing_campaigns_log";
|
||||||
if ($countryCode) {
|
if ($countryCode) {
|
||||||
$sqlStats .= " WHERE country_code = :country";
|
$sqlStats .= " WHERE country_code = :country";
|
||||||
|
$sqlStats .= " GROUP BY message_type";
|
||||||
$stmtStats = $con->prepare($sqlStats);
|
$stmtStats = $con->prepare($sqlStats);
|
||||||
$stmtStats->execute([':country' => strtoupper($countryCode)]);
|
$stmtStats->execute([':country' => strtoupper($countryCode)]);
|
||||||
} else {
|
} else {
|
||||||
|
$sqlStats .= " GROUP BY message_type";
|
||||||
$stmtStats = $con->prepare($sqlStats);
|
$stmtStats = $con->prepare($sqlStats);
|
||||||
$stmtStats->execute();
|
$stmtStats->execute();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ if ($role !== 'admin' && $role !== 'super_admin') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null);
|
$countryCode = filterRequest('country_code');
|
||||||
|
|
||||||
if (!$countryCode) {
|
if (!$countryCode) {
|
||||||
jsonError("Missing required parameter: country_code");
|
jsonError("Missing required parameter: country_code");
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ if ($role !== 'admin' && $role !== 'super_admin') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null);
|
$countryCode = filterRequest('country_code');
|
||||||
|
|
||||||
if (!$countryCode) {
|
if (!$countryCode) {
|
||||||
jsonError("Missing required parameter: country_code");
|
jsonError("Missing required parameter: country_code");
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ if ($role !== 'admin' && $role !== 'super_admin') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null);
|
$countryCode = filterRequest('country_code');
|
||||||
$proposedSpeedPrice = (float)filterRequest('speed_price');
|
$proposedSpeedPrice = (float)filterRequest('speed_price');
|
||||||
|
|
||||||
if (!$countryCode || $proposedSpeedPrice <= 0) {
|
if (!$countryCode || $proposedSpeedPrice <= 0) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ if ($role !== 'admin' && $role !== 'super_admin') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$countryCode = resolveAdminCountry(filterRequest('country_code'), $role, $admin_country ?? null);
|
$countryCode = filterRequest('country_code');
|
||||||
|
|
||||||
if (!$countryCode) {
|
if (!$countryCode) {
|
||||||
jsonError("Missing required parameter: country_code");
|
jsonError("Missing required parameter: country_code");
|
||||||
|
|||||||
Reference in New Issue
Block a user