Update: 2026-06-30 21:12:26

This commit is contained in:
Hamza-Ayed
2026-06-30 21:12:26 +03:00
parent c2eab19045
commit 1ae8acad7a
14 changed files with 90 additions and 55 deletions

View File

@@ -21,9 +21,9 @@ $siroBasePrice = filterRequest('siro_base_price', 'float') ?? 10000.0;
try {
// 3. Fetch recent competitor prices for this region to supply context to Gemini
$sqlPrices = "SELECT competitor_name, total_price, distance_km
FROM competitor_prices
WHERE country_code = :country
$sqlPrices = "SELECT competitor_name, price_amount AS total_price, (price_amount / price_per_km) AS distance_km
FROM scraped_competitor_prices
WHERE country_code = :country AND price_per_km > 0
ORDER BY created_at DESC LIMIT 10";
$stmtPrices = $con->prepare($sqlPrices);
$stmtPrices->execute([':country' => strtoupper($countryCode)]);