/** * 删除帖子 * @param Post $post */ public static function delete(Post $post) { $post->setAttributes(['status' => Post::STATUS_DELETED]); $post->save(); Notification::updateAll(['status' => Post::STATUS_DELETED], ['post_id' => $post->id]); }