public function actionAddfrontmodel() { $year = Yii::app()->request->getParam('year'); $model = Yii::app()->request->GetParam('model'); $res = GoodsModel::model()->findByPk($model); $data['year'] = $res['year']; $data['model'] = $res['name']; echo json_encode($data); }