From 40ffcabc9151da61ed9051c9d277d629b48769b4 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sun, 5 Jul 2026 18:46:09 +0300 Subject: [PATCH] Update: 2026-07-05 18:46:09 --- backend/bot/cron_weekly_health_report.php | 2 +- backend/core/Services/SiroGeminiService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/bot/cron_weekly_health_report.php b/backend/bot/cron_weekly_health_report.php index ca5d06c9..1780f27f 100644 --- a/backend/bot/cron_weekly_health_report.php +++ b/backend/bot/cron_weekly_health_report.php @@ -75,7 +75,7 @@ try { // 3. Automated Campaigns / Surge Tracking (If applicable in logs) $sqlCampaigns = "SELECT COUNT(*) as count FROM marketing_campaigns_log - WHERE JSON_EXTRACT(target_criteria, '$.country_code') = :country + WHERE country_code = :country AND sent_at >= DATE_SUB(NOW(), INTERVAL 7 DAY)"; $stmtCampaigns = $con->prepare($sqlCampaigns); $stmtCampaigns->execute([':country' => $countryCode]); diff --git a/backend/core/Services/SiroGeminiService.php b/backend/core/Services/SiroGeminiService.php index bc853f92..0b436cd5 100644 --- a/backend/core/Services/SiroGeminiService.php +++ b/backend/core/Services/SiroGeminiService.php @@ -195,7 +195,7 @@ class SiroGeminiService { /** * Helper: يُرسل prompt لـ Gemini ويُعيد JSON مُفكَّك */ - private function callGemini(string $prompt, string $model): ?array { + public function callGemini(string $prompt, string $model): ?array { $apiUrl = $this->baseUrl . $model . ":generateContent?key=" . $this->apiKey; $payload = [