【发布时间】:2012-08-27 18:20:31
【问题描述】:
例如,我有一个包含 fromH 和 toH 字段的 Store 模型,我想从数据库中检索在给定时间 (@t) 开放的商店。
SQL 查询如下所示
select *
from store
where
( fromH < toH and @t between fromH and toH ) or
( fromH > toH and
(@t between fromH and 24 OR
(@t between 1 and toH )
)
我如何在 cakephp 中实现这个查询,条件数组看起来如何?我想做蛋糕风格。
【问题讨论】:
标签: cakephp cakephp-1.3 cakephp-2.0 cakephp-2.1 cakephp-1.2