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']);
}