Warning: Use of undefined constant hot - assumed 'hot' (this will throw an Error in a future version of PHP) in /data/wwwroot/lxy.me/wp-content/themes/Ality/inc/sticky-cat.php on line 5


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,...