Update: 2026-06-21 02:07:00
This commit is contained in:
@@ -13,6 +13,11 @@ if ($isDriverCallPassenger === null || $isDriverCallPassenger === "") {
|
||||
$isDriverCallPassenger = "0";
|
||||
}
|
||||
|
||||
if (!$driverID || !$passengerID || !$rideID) {
|
||||
jsonError("Missing required fields");
|
||||
exit();
|
||||
}
|
||||
|
||||
// استخدام التاريخ الحالي
|
||||
$dateCreated = date("Y-m-d H:i:s");
|
||||
|
||||
@@ -42,6 +47,16 @@ $stmt->bindParam(":dateCreated", $dateCreated);
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Invalidate Redis cache key for this driver
|
||||
if (isset($redis) && $redis !== null && $driverID) {
|
||||
try {
|
||||
$today = date("Y-m-d");
|
||||
$redisKey = "driver:scam_count:" . $driverID . ":" . $today;
|
||||
$redis->del($redisKey);
|
||||
} catch (Exception $e) {
|
||||
error_log("[add.php] Redis cache invalidation failed: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
jsonSuccess(null, "Driver ride scam data saved successfully");
|
||||
} else {
|
||||
jsonError("Failed to save driver ride scam data");
|
||||
|
||||
Reference in New Issue
Block a user