sxtuwy 2012-08-29 12:11:07 6364次浏览 3条回复 0 0 0
$criteria=new CDbCriteria(array(
    'order'=>'id asc',
));
$count = Grade::model()->count($criteria);
$model=Grade::model()->findAll($criteria);
//$arr=array(array('id'=>1,'title'=>'高一'),array('id'=>1,'title'=>'高三'));
$data2=CJSON::encode($model);
$data='{'.'"total":'.$count.','.'"rows":'.$data2.'}';
echo $data;
您需要登录后才可以回复。登录 | 立即注册