$criteria->addCondition("id=:id"); //查询条件,即where id = 1 $criteria->addBetweenCondition('id', 1, 4);//between 1 and 4 $criteria->addInCondition('id', array(1,2,3,4,5)); //代表where id IN (1,23,,4,5,); $criteria->addNotInCondition('id', array(1,2,3,4,5)); //与上面正好相法,是NOT IN
【where 查询字符串字段】
$criteria->addSearchCondition('name', '分类', true); //搜索条件,其实代表了。。where name like '%分类%';