frontend\modules\tweet\controllers\DefaultController::actionDelete PHP Method

actionDelete() public method

伪删除
public actionDelete ( $id ) : Response
$id
return yii\web\Response
    public function actionDelete($id)
    {
        /** @var Tweet $model */
        $model = Tweet::findTweet($id);
        if (!$model->isCurrent()) {
            throw new NotFoundHttpException();
        }
        if ($model->comment_count) {
            $this->flash("已有评论,属于共有财产,不能删除", 'warning');
        } else {
            TweetService::delete($model);
            $this->flash("删除成功。 ", 'success');
        }
        return $this->redirect(['index']);
    }