public function actionCreate() { $model = new Buyer(); if ($model->load(Yii::$app->request->post())) { // 获取用户输入的数据,验证并保存 $model->create_time = date('Y-m-d H:i:s'); //var_dump($model); if ($model->save()) { $this->redirect('/buyer/index'); } } $platforms = Platform::find()->all(); return $this->renderAjax('create', array('model' => $model, 'platforms' => $platforms)); }