【发布时间】:2014-07-31 16:43:09
【问题描述】:
我开始使用锂 PHP 框架。我必须进行查询以获取在“标题”字段中有“%test%”或“%easy%”的问题。 我尝试使用以下代码:
$questions = Questions::find('all', array(
'conditions' => array(
'name' => array(
'like' => array(
'%easy%',
'%test%'
)
)
)
));
但它会进行以下查询:
SELECT * FROM `questions` AS `Questions` WHERE (`name` LIKE '%easy%' AND `name` LIKE '%test%')
如何用 OR 代替 AND?
【问题讨论】: