OkKU_FIXED DESK
Wed Sep 07 2022 16:45:41 GMT+0000 (Coordinated Universal Time)
Saved by
@atharlaique
#javascript
#nodejs
select
wr.start_datetime,
wr.end_datetime,
wr.object_id,
wr.reserved_by_user,
wr.reserved_for_user,
wr.reservation_hash,
wo.object_name as objectName,
wo.object_type as objectType
from wmt_reservations wr
left join wmt_objects wo
on wr.object_id = wo.object_id and wr.org = wo.org and wr.org_path = wo.org_path
left join wmt_reservation_guests wrg
on wrg.reservation_id = wr.id
where wr.org = 'okku' and wr.org_path = '/demo' and wr.cancelled_at is null and wr.visible_to_others is true
UNION all
select DISTINCT on
(wo2.regular_user)
wr2.start_datetime,
wr2.end_datetime,
wr2.object_id,
wr2.reserved_by_user,
wr2.reserved_for_user,
wr2.reservation_hash,
wo2.object_name as objectName,
wo2.object_type as objectType
from wmt_objects wo2
left join wmt_reservations wr2
on wr2.org = wo2.org and wr2.org_path = wo2.org_path
where wo2.regular_user is not null
content_copyCOPY
Comments