fix prices reloading
This commit is contained in:
@@ -6,6 +6,11 @@ returns jsonb
|
||||
language sql
|
||||
stable
|
||||
as $fn$
|
||||
with bounds as (
|
||||
select
|
||||
((p_day::timestamp) at time zone 'Europe/Prague') as day_start_utc,
|
||||
(((p_day + 1)::timestamp) at time zone 'Europe/Prague') as day_end_utc
|
||||
)
|
||||
select coalesce(
|
||||
jsonb_agg(u.j order by u.interval_start),
|
||||
'[]'::jsonb
|
||||
@@ -17,8 +22,10 @@ as $fn$
|
||||
from (
|
||||
select v.*
|
||||
from ems.vw_site_effective_price v
|
||||
cross join bounds b
|
||||
where v.site_id = p_site_id
|
||||
and (v.interval_start at time zone 'Europe/Prague')::date = p_day
|
||||
and v.interval_start >= b.day_start_utc
|
||||
and v.interval_start < b.day_end_utc
|
||||
order by v.interval_start
|
||||
) t
|
||||
) u;
|
||||
|
||||
Reference in New Issue
Block a user