Update: 2026-07-25 18:43:44
This commit is contained in:
@@ -18,7 +18,7 @@ try {
|
||||
COUNT(r.id) as total_rides
|
||||
FROM driver d
|
||||
LEFT JOIN ride r ON d.id = r.driver_id AND LOWER(r.status) IN ('finished','completed')
|
||||
GROUP BY d.id, d.first_name, d.last_name, d.phone
|
||||
GROUP BY d.id
|
||||
HAVING total_earned > 0
|
||||
ORDER BY total_earned DESC
|
||||
LIMIT 50
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Admin/v2/quality/blacklist_manager.php
|
||||
require_once __DIR__ . '/../../../connect.php';
|
||||
require_once __DIR__ . '/../../../encrypt_decrypt.php';
|
||||
require_once __DIR__ . '/../security/audit_logs_helper.php'; // إذا كان متاحاً، وإلا سننفذ الإدخال مباشرة
|
||||
|
||||
if ($role !== 'admin' && $role !== 'super_admin') {
|
||||
jsonError("Unauthorized", 403);
|
||||
|
||||
@@ -10,22 +10,7 @@ if ($role !== 'admin' && $role !== 'super_admin') {
|
||||
|
||||
$driver_id = filterRequest('driver_id');
|
||||
if (!$driver_id) {
|
||||
try {
|
||||
$stmt = $con->prepare("SELECT id, first_name, last_name, phone, status FROM driver ORDER BY id DESC LIMIT 20");
|
||||
$stmt->execute();
|
||||
$drivers = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
foreach ($drivers as &$d) {
|
||||
if (!empty($d['first_name'])) $d['first_name'] = $encryptionHelper->decryptData($d['first_name']) ?: $d['first_name'];
|
||||
if (!empty($d['last_name'])) $d['last_name'] = $encryptionHelper->decryptData($d['last_name']) ?: $d['last_name'];
|
||||
if (!empty($d['phone'])) $d['phone'] = $encryptionHelper->decryptData($d['phone']) ?: $d['phone'];
|
||||
}
|
||||
unset($d);
|
||||
jsonSuccess($drivers);
|
||||
exit;
|
||||
} catch (Throwable $e) {
|
||||
jsonSuccess([]);
|
||||
exit;
|
||||
}
|
||||
jsonError("Missing driver_id", 400);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user