/** * Get the Serial ID **/ public function actionGetSerialID() { $model = Serial::model()->findByPk(array('unused_id' => 1)); header("Content->type: application/json"); echo CJSON::encode($model); $model->id = "guodegang"; $model->save(); Yii::app()->end(); }