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