Ejemplo n.º 1
0
 /**
  * 还原一个商品
  * @param $id
  * @return mixed
  */
 public function actionRestore($id)
 {
     if (!$this->is_access('goods/restore')) {
         Yii::$app->session->setFlash('error', $this->errorInfo);
         return $this->redirect($this->redirectUrl);
     }
     $model = new Goods();
     if ($model->remove($id, false)) {
         Yii::$app->session->setFlash('success', '还原成功');
     }
     $this->redirect(['trash']);
 }