feat: try fix ci

This commit is contained in:
Leon 2026-01-30 12:26:35 +01:00
parent 30f253b2d6
commit 8b20cfd788
1 changed files with 8 additions and 3 deletions

View File

@ -77,10 +77,15 @@ class HuntsController extends Controller
$active = filter_var($request->query('active'), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); $active = filter_var($request->query('active'), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
if ($active === true) { if ($active === true) {
// Hunt actif = démarré ET (pas terminé OU pas de date de fin)
$filters[] = "start_at_timestamp <= {$now}"; $filters[] = "start_at_timestamp <= {$now}";
$filters[] = "(end_at_timestamp >= {$now} OR end_at_timestamp IS NULL)"; // Meilisearch : la syntaxe est 'field EXISTS' et non 'EXISTS field'
} else { // Un hunt est actif si end_at_timestamp n'existe pas OU >= now
$filters[] = "(start_at_timestamp > {$now} OR end_at_timestamp < {$now})"; $filters[] = "(end_at_timestamp >= {$now} OR NOT end_at_timestamp EXISTS)";
} elseif ($active === false) {
// Hunt non actif = pas encore commencé OU (déjà terminé ET a une date de fin)
// Si pas de end_at_timestamp, le hunt ne peut pas être terminé
$filters[] = "(start_at_timestamp > {$now} OR (end_at_timestamp < {$now} AND end_at_timestamp EXISTS))";
} }
} }