gpt4 book ai didi

PHP+CalDav+ICS 房间时隙算法?

转载 作者:行者123 更新时间:2023-11-29 13:23:12 26 4
gpt4 key购买 nike

我目前正在一个预订网站上工作。我正在使用 PHP Baikal CalDav Server(对其进行了修改)。当通过 Mozilla Thunderbird 或 iCal 生成时,Baikal 生成的 ical 文件将 VCALENDAR(每个事件)文件作为 mysql 中的介质 blob 存储在单列中。此外,我在网站上的预订也存储为 VCALENDAR 文件。

如果我想检查房间是否可用,我必须获取与 room_id 匹配的每个 VCALENDAR 文件并从 VCALENDAR 中提取信息。不知道这个手术成本是不是太高了。我尝试从已使用且不重复使用的 VCALENDARS 中“清理”数据库。

I have to open the room_id opening hours VCALENDAR -> extract data with Sabre process

For Loop through Exception VCALENDAR -> extract data with Sabre process

For Loop through Baikal VCALENDAR -> extract data with Sabre process

For Loop through Bookings VCALENDAR -> extract data with Sabre process

-> Process All -> Return Result, if room is free in the given time.

他们是否有任何智能算法,可以在拥有 ics 文件(开放时间、异常(exception)情况、预订、贝加尔湖预订)时检查给定时间段内的房间可用性?

谢谢!

最佳答案

直接查询SabreDAV。它针对基于时间的查询进行了高度优化。如果您执行 calendar-query REPORT HTTP 请求,并筛选开始时间和结束时间,它将仅返回与该时间范围重叠的事件。

您甚至可以要求它抓取该时间范围内的所有事件,并将其转换为 VFREEBUSY 报告,该报告基本上是一个简化的 VCALENDAR,其中准确列出了哪些时间段开放和未开放。

您可以在CalDAV specification中找到有关这些报告的更多信息。

关于PHP+CalDav+ICS 房间时隙算法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20497200/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com