From 067e8a96a8aeb5db2a8174ca0bdcca17c42556a4 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 12 Dec 2019 14:41:27 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/NoticeController.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Http/Controllers/Admin/NoticeController.php b/app/Http/Controllers/Admin/NoticeController.php index d6082392..c7d6bc49 100644 --- a/app/Http/Controllers/Admin/NoticeController.php +++ b/app/Http/Controllers/Admin/NoticeController.php @@ -41,4 +41,20 @@ class NoticeController extends Controller 'data' => true ]); } + + public function drop (Request $request) { + if (empty($request->input('id'))) { + abort(500, '参数错误'); + } + $notice = Notice::find($request->input('id')); + if (!$notice) { + abort(500, '公告不存在'); + } + if ($notice->delete()) { + abort(500, '删除失败'); + } + return response([ + 'data' => true + ]); + } }