yasdasd
All checks were successful
Deploy / deploy (push) Successful in 56s

This commit is contained in:
2026-08-10 22:57:21 +02:00
parent 018496f720
commit 5d979e60bf
11 changed files with 314 additions and 33 deletions

View File

@@ -493,6 +493,81 @@ final class ListingCatalog
return $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: [];
}
public function listEventLocationOptions(int $limit = 80): array
{
$this->ensureSchema();
$stmt = $this->pdo->prepare(
'SELECT l.id,
l.listing_type,
l.title,
l.status,
lp.street,
lp.zip,
lp.city,
lp.region,
lp.lat,
lp.lng,
lp.place_kind,
lo.starts_at,
lo.recurrence_until,
lc.slug AS category_slug,
lc.title AS category_title
FROM listings l
LEFT JOIN listing_places lp ON lp.id = l.primary_place_id
LEFT JOIN listing_occurrences lo ON lo.listing_id = l.id
LEFT JOIN listing_category_map lcm ON lcm.listing_id = l.id
LEFT JOIN listing_categories lc ON lc.id = lcm.category_id
WHERE l.listing_type IN ("place","editorial_event")
AND l.status IN ("draft","published")
ORDER BY
CASE l.listing_type
WHEN "place" THEN 1
WHEN "editorial_event" THEN 2
ELSE 3
END,
l.title ASC,
COALESCE(lo.starts_at, l.created_at) ASC
LIMIT :limit'
);
$stmt->bindValue(':limit', max(1, min(250, $limit)), \PDO::PARAM_INT);
$stmt->execute();
return $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: [];
}
public function getEventLocationSource(int $listingId): ?array
{
$this->ensureSchema();
$stmt = $this->pdo->prepare(
'SELECT l.id,
l.listing_type,
l.title,
l.status,
lp.street,
lp.zip,
lp.city,
lp.region,
lp.lat,
lp.lng,
lp.place_kind,
lo.starts_at,
lo.recurrence_until,
lc.slug AS category_slug,
lc.title AS category_title
FROM listings l
LEFT JOIN listing_places lp ON lp.id = l.primary_place_id
LEFT JOIN listing_occurrences lo ON lo.listing_id = l.id
LEFT JOIN listing_category_map lcm ON lcm.listing_id = l.id
LEFT JOIN listing_categories lc ON lc.id = lcm.category_id
WHERE l.id = :id
AND l.listing_type IN ("place","editorial_event")
AND l.status IN ("draft","published")
LIMIT 1'
);
$stmt->execute(['id' => $listingId]);
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
return $row ?: null;
}
public function listUserOpenModerationRequestMap(int $userId): array
{
$this->ensureSchema();