嗨,我正试图做这样的情况:
array("Curriculum.name LIKE" => $array,"Curriculum.surname LIKE" => $array,)
但是cakephp输出如下:
WHERE ((`Curriculum`.`name` LIKE IN ('%jon%','%x%')) OR (`Curriculum`.`surname` LIKE IN ('%jon%','%x%'))
如何实现这一目标?
答案 0 :(得分:18)
foreach ($array as $name) {
$conditions['or'][] = array('Curriculum.name LIKE' => "%$name%");
$conditions['or'][] = array('Curriculum.surname LIKE' => "%$name%");
}