cakephp复杂条件查找

$conditions = array('and' => array('Field.id = 3', 'or' => array('Field.id = 1', 'Field.id = 2')));


sql文将是这样:
WHERE (`Field`.`id` = 3) AND ((`Field`.`id` = 1) OR (`Field`.`id` = 2))


如果是或者的关系还可以这样写:

'conditions'=>array(
					'Field.id'=>array('1','2','3'),
				),


仅供参考。

你可能感兴趣的:(sql,PHP,cakephp)