Yii中CDbCriteria的常用方法

Yii中CDbCriteria的常用方法
Yii中CDbCriteria的常用方法,一般在search()函数里 $criteria = new CDbCriteria(); $criteria->addCondition("username='".Yii::app()->user->name."'");//获取传递当前登录用户 $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,...