Update: 2026-07-05 18:31:10
This commit is contained in:
@@ -14,8 +14,7 @@
|
|||||||
require_once __DIR__ . '/../core/bootstrap.php';
|
require_once __DIR__ . '/../core/bootstrap.php';
|
||||||
require_once __DIR__ . '/../core/Services/SiroGeminiService.php';
|
require_once __DIR__ . '/../core/Services/SiroGeminiService.php';
|
||||||
require_once __DIR__ . '/../core/Security/EncryptionHelper.php';
|
require_once __DIR__ . '/../core/Security/EncryptionHelper.php';
|
||||||
// تأكد من وجود دالة إرسال الإشعارات
|
require_once __DIR__ . '/../functions.php';
|
||||||
// require_once __DIR__ . '/../functions.php'; // already loaded in bootstrap if configured
|
|
||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ set_time_limit(120);
|
|||||||
ini_set('memory_limit', '256M');
|
ini_set('memory_limit', '256M');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$con = Database::get('main');
|
$con = Database::get('main');
|
||||||
$redis = getRedisConnection();
|
$conRide = Database::get('ride');
|
||||||
|
$redis = getRedisConnection();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
die("[PredictiveDemand] Connection failed: " . $e->getMessage() . "\n");
|
die("[PredictiveDemand] Connection failed: " . $e->getMessage() . "\n");
|
||||||
}
|
}
|
||||||
@@ -69,14 +70,14 @@ $sqlHistory = "
|
|||||||
";
|
";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$stmtH = $con->prepare($sqlHistory);
|
$stmt = $conRide->prepare($sqlHistory);
|
||||||
$stmtH->bindValue(':grid', $GRID_SIZE, PDO::PARAM_STR);
|
$stmt->bindValue(':grid', $GRID_SIZE, PDO::PARAM_STR);
|
||||||
$stmtH->bindValue(':next_hour', $targetHourNext, PDO::PARAM_INT);
|
$stmt->bindValue(':next_hour', $targetHourNext, PDO::PARAM_INT);
|
||||||
$stmtH->bindValue(':dow', $currentDow, PDO::PARAM_INT);
|
$stmt->bindValue(':dow', $currentDow, PDO::PARAM_INT);
|
||||||
$stmtH->bindValue(':weeks', $WEEKS_HISTORY, PDO::PARAM_INT);
|
$stmt->bindValue(':weeks', $WEEKS_HISTORY, PDO::PARAM_INT);
|
||||||
$stmtH->bindValue(':top', $TOP_ZONES * 3, PDO::PARAM_INT); // نأخذ أكثر لنصفيها لاحقاً
|
$stmt->bindValue(':top', $TOP_ZONES * 3, PDO::PARAM_INT); // نأخذ أكثر لنصفيها لاحقاً
|
||||||
$stmtH->execute();
|
$stmt->execute();
|
||||||
$hotZones = $stmtH->fetchAll(PDO::FETCH_ASSOC);
|
$hotZones = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
die("[PredictiveDemand] Query error: " . $e->getMessage() . "\n");
|
die("[PredictiveDemand] Query error: " . $e->getMessage() . "\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user