[英]Booking Calendar Data Presentation
I am developing a booking calendar and I want to represent the availability of cabins by time slots as below.我正在开发一个预订日历,我想按如下时间段表示客舱的可用性。
And display a combined "availability" view of all the cabins as below:并显示所有客舱的组合“可用性”视图,如下所示:
What would be the best table structure in order to represent this requirement.为了表示这一要求,最好的表结构是什么。 and how can I query the database to get my final overall availability screen?以及如何查询数据库以获得最终的整体可用性屏幕? Can i get the intended output in one query?我可以在一次查询中获得预期的 output 吗?
Or any proposals to represent the overall availability of cabins in a better way than above is most welcome.或者任何以比上述更好的方式代表客舱整体可用性的建议都是最受欢迎的。
Your suggestions are much appreciated.非常感谢您的建议。
A simple structure might be as follows:一个简单的结构可能如下:
cabins
(cabin_id*
,cabin_name)
bookings
(booking_id*
,cabin_id
,from_datetime
,to_datetime)
* = (component of) PRIMARY KEY
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.