我需要存储200多个独特企业的营业时间(数量还在增长中)。每个企业的营业时间都不同,有些还会在午餐时段关闭。此外,一个企业可能一天早上8点开门,而另一天早上9点才开门。我的初步想法是建立一个MySQL表来处理这个问题,但后来我考虑将其存储在单个单元格中并将结果分解开来。如果将其分解开来,我会像这样存储它...
// "8:00-17:00|9:00-18:00|8:30-12:30,13:30-17:30|8:00-17:00|8:00-17:00|8:00-11:00||"
// For Day Data: Explode "|"
// For Open/Close Data: Explode "-"
// For Converting to am/pm: Explode ":"
使用单个单元格存储,可以对从 clientData 表中提取的数据进行数组处理(已经通过循环处理)。如果使用单独的 MySQL 表,则每个客户端需要 7-14 行数据(根据其构建方式而定),起始行数为 1,400 - 2,800 行。这两种方法哪种更好?您会如何处理呢?
谢谢!
<div class="businessHours" itemscope itemtype="http://schema.org/LocalBusiness">
<time itemprop="openingHours" datetime="Mo 8:00-17:00"><strong>Monday:</strong> <span>8:00am-5:00pm</span></time>
<time itemprop="openingHours" datetime="Tu 9:00-18:00"><strong>Tuesday:</strong> <span>9:00am-6:00pm</span></time>
<time itemprop="openingHours" datetime="We 8:30-12:30,13:30am-17:30"><strong>Wednesday:</strong> <span>8:30am-12:30pm, 1:30pm-5:30pm</span></time>
<time itemprop="openingHours" datetime="Th 9:00-18:00"><strong>Thursday:</strong> <span>9:00am-6:00pm</span></time>
<time itemprop="openingHours" datetime="Fr 8:00-17:00"><strong>Friday:</strong> <span>8:00am-5:00pm</span></time>
<time itemprop="openingHours" datetime="Sa 8:00-1:00"><strong>Saturday:</strong> <span>8:00am-11am</span></time>
<time itemprop="openingHours" datetime="Su "><strong>Sunday:</strong> <span>Closed</span></time>
</div>