日期:2014-05-16 浏览次数:20391 次
// 返回符合条件记录的件数 $account_cnt = Student::model()->count("age=:age and sex=:sex ",array( ':age'=>trim($age), ':sex'=>trim($sex), )); // 返回该条件下的记录是否存在 $criteria = new CDbCriteria; $criteria->condition = "age=:age and sex=:sex and type in ('1','2')"; $criteria->params = array(':isp_id'=>yii::app()->user->getState('ispid'), ':age'=>trim($age), ':sex'=>trim($sex), ); $isExsit = Student::model()->exists($criteria);