T4XGM2U2W7W3SM424W6JNEIJWOJQ5ILZWU45JPZUKTZMK77ZARKQC THLWHHEQ2F5SFTHE4FE2PVSYNYRLP7QN6J3O6S3RXQX3KZYYWVYAC 63VXWIHIAKGK7J4VTNRUAG2V32N2QUSWFELB6GD34S54FGRWAPCQC E4HFJ4L4PAGV7R7EXVG2B2CWDGGW7XWU4D37VURZ66HZ3ILHCFUAC NBNPI4ATCXHIMKSXW5VRS3KM4WJZZMOPD7H4QTDNOQFRSQYFSIBAC XQA3IQXSGAO2FST3F64WLVZ7JNLMQYKT3LO4SHHKYR2D765OPGHQC TQZJC7K5WOURWCLEFW3OP2SBWE3IGMCXBBLNVDKAPQS7NEHSLRJAC 72DUSPYXB64ECTFQWWD7XSY4YJUNRCFZT22AS4BDRIIUZP33CZGAC images,times,
(select json_agg(url) from store_image where store_image.store_id = store.store_id),(select json_build_object(x, array_agg) from (selectcasewhen wow then 6else lower(open) / 1440end as x,array_agg(open order by casewhen wow then 2147483647else lower(open)end asc)from (selectlower(open) = 0 and exists(select 1from store_timewherestore_time.store_id = store.store_id andupper(open) = 10080) as wow,openfrom store_timewhere store_time.store_id = store.store_id) as tgroup by xorder by x asc) as y)
fromstoreleft outer join (selectstore_id,json_agg(url) as imagesfromstore_image--order by rankgroup bystore_id) as store_images using (store_id)left outer join (selectstore_id,json_agg(open) as times--combine the ranges? key value? (day : array of times)fromstore_timegroup bystore_id) as store_times using (store_id)
from store