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