Fix ordering of past polls

This commit is contained in:
Alex Cabal 2023-08-08 12:58:11 -05:00
parent 505352a3ec
commit 39b885033e

View file

@ -3,18 +3,18 @@ $pastPolls = Db::Query('
SELECT *
from Polls
where utc_timestamp() >= end
order by Created desc
order by Start desc
', [], 'Poll');
$openPolls = Db::Query('
SELECT *
from Polls
where (end is null
or utc_timestamp() <= end)
where (End is null
or utc_timestamp() <= End)
and
(start is null
or start <= utc_timestamp())
order by Created desc
(Start is null
or Start <= utc_timestamp())
order by Start desc
', [], 'Poll');
?><?= Template::Header(['title' => 'Polls', 'highlight' => '', 'description' => 'The various polls active at Standard Ebooks.']) ?>