frontend\modules\topic\controllers\DefaultController::actionExcellent PHP Method

actionExcellent() public method

加精华
public actionExcellent ( $id ) : Response
$id
return yii\web\Response
    public function actionExcellent($id)
    {
        $user = Yii::$app->user->identity;
        $model = Topic::findTopic($id);
        if ($user && ($user->isAdmin($user->username) || $user->isSuperAdmin($user->username))) {
            TopicService::excellent($model);
            $this->flash("操作成功", 'success');
            return $this->redirect(['/topic/default/view', 'id' => $model->id]);
        } else {
            throw new NotFoundHttpException();
        }
    }