|
@ -9,6 +9,7 @@ use yii\web\Controller; |
|
|
use yii\web\NotFoundHttpException; |
|
|
use yii\web\NotFoundHttpException; |
|
|
use yii\filters\VerbFilter; |
|
|
use yii\filters\VerbFilter; |
|
|
use iron\widget\Excel; |
|
|
use iron\widget\Excel; |
|
|
|
|
|
use yii\web\Response; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* CommentController implements the CRUD actions for Comment model. |
|
|
* CommentController implements the CRUD actions for Comment model. |
|
@ -147,4 +148,32 @@ class CommentController extends Controller |
|
|
'columns' => $searchModel->columns() |
|
|
'columns' => $searchModel->columns() |
|
|
]); |
|
|
]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 显示评论 |
|
|
|
|
|
* @param $id |
|
|
|
|
|
* @return Response |
|
|
|
|
|
* @throws NotFoundHttpException |
|
|
|
|
|
*/ |
|
|
|
|
|
public function actionDisplay($id) |
|
|
|
|
|
{ |
|
|
|
|
|
$model = $this->findModel($id); |
|
|
|
|
|
$model->status = Comment::STATUS_DISPLAY; |
|
|
|
|
|
$model->save(); |
|
|
|
|
|
return $this->redirect(['index']); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 隐藏评论 |
|
|
|
|
|
* @param $id |
|
|
|
|
|
* @return Response |
|
|
|
|
|
* @throws NotFoundHttpException |
|
|
|
|
|
*/ |
|
|
|
|
|
public function actionHide($id) |
|
|
|
|
|
{ |
|
|
|
|
|
$model = $this->findModel($id); |
|
|
|
|
|
$model->status = Comment::STATUS_HIDE; |
|
|
|
|
|
$model->save(); |
|
|
|
|
|
return $this->redirect(['index']); |
|
|
|
|
|
} |
|
|
} |
|
|
} |