示例#1
0
 /**
  * Creates a new Merchant model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Merchant();
     if ($model->load(Yii::$app->request->post())) {
         $model->i = uniqid();
         $model->user_id = Yii::$app->user->id;
         if ($model->save()) {
             return $this->redirect(['index']);
         }
     }
     return $this->render('create', ['model' => $model]);
 }