$criteria = new CDbCriteria; $criteria->addCondition("id=1"); //查询条件,即where id = 1 $criteria->addInCondition(,,,,)); //代表where id IN (1,23,,4,5,); $criteria->addNotInCondition(,,,,));//与上面正好相法,是NOT IN $criteria->addCondition('id=1','…
一.一个sql拼装的情况 $criteria = new CDbCriteria; //函数方式 $criteria->addCondition("id=1"); //查询条件,即where id = 1 $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))…
$criteria = new CDbCriteria;$criteria->compare('name',$this->name,true,'OR'); //like部分匹配//$criteria->addCondition("id=1"); //查询条件,即where id = 1//$criteria->addInCondition('id', array(1,2,3,4,5)); //代表where id IN (1,2,3,4,5);$criteria…
$criteria = new CDbCriteria; //$criteria->alias = 't'; //查询该表 $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 $criteria->addCondition('id=…