+
+
+
+
Karte anklicken, um Standort zu wählen. Ziehen/Zoomen möglich.
+
+
+
Bitte gib einen Suchbegriff oder einen Ort ein.
@@ -104,3 +114,105 @@ if ($pdo && ($q !== '' || $loc !== '' || ($lat !== null && $lng !== null))) {
+
diff --git a/src/App/Search.php b/src/App/Search.php
index 2f310c5..1d29d8b 100644
--- a/src/App/Search.php
+++ b/src/App/Search.php
@@ -88,7 +88,7 @@ final class Search
// Radius for HAVING
$bind[] = $radius;
} else {
- $sql = "SELECT id, title, teaser_public, description, city, region, zip, starts_at, visibility, allow_kids, location_label, lat, lng, 1 AS distance_km";
+ $sql = "SELECT id, title, teaser_public, description, city, region, zip, starts_at, visibility, allow_kids, location_label, lat, lng, NULL AS distance_km";
$bind = $bindTokens;
}
@@ -107,6 +107,12 @@ final class Search
try {
$stmt->execute($bind);
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: [];
+ if (!$hasGeo) {
+ foreach ($rows as &$r) {
+ unset($r['distance_km']);
+ }
+ unset($r);
+ }
// Fuzzy filter: allow slight typos (Levenshtein <= 1 or 2)
if ($tokens) {
$rows = array_values(array_filter($rows, function ($row) use ($tokens) {