|
@@ -36,6 +36,8 @@ JOIN sqlpage_options og ON og.type = 'group' AND g.name = og.name
|
|
JOIN sqlpage_options ot ON ot.type = 'tag' AND tg.name = ot.name
|
|
JOIN sqlpage_options ot ON ot.type = 'tag' AND tg.name = ot.name
|
|
WHERE
|
|
WHERE
|
|
COALESCE(op.selected, oc.selected, og.selected, TRUE)
|
|
COALESCE(op.selected, oc.selected, og.selected, TRUE)
|
|
|
|
+AND
|
|
|
|
+ COALESCE(ot.selected, TRUE)
|
|
AND
|
|
AND
|
|
op.session = sqlpage.cookie('session')
|
|
op.session = sqlpage.cookie('session')
|
|
AND
|
|
AND
|
|
@@ -79,7 +81,11 @@ AND
|
|
ot.session = sqlpage.cookie('session')
|
|
ot.session = sqlpage.cookie('session')
|
|
AND
|
|
AND
|
|
((ts AT TIME ZONE 'UTC') AT TIME ZONE 'Pacific/Auckland')::date
|
|
((ts AT TIME ZONE 'UTC') AT TIME ZONE 'Pacific/Auckland')::date
|
|
- BETWEEN $start::date AND $end::date
|
|
|
|
|
|
+ BETWEEN (
|
|
|
|
+ SELECT name FROM sqlpage_options WHERE type = 'start'
|
|
|
|
+ )::date AND (
|
|
|
|
+ SELECT name FROM sqlpage_options WHERE type = 'end'
|
|
|
|
+ )::date
|
|
);
|
|
);
|
|
SELECT * FROM sqlpage_tags;
|
|
SELECT * FROM sqlpage_tags;
|
|
|
|
|