update: add coupon and notice switch

This commit is contained in:
tokumeikoi
2022-01-22 02:30:05 +08:00
parent 94a7ab412c
commit 1790de63f6
8 changed files with 55 additions and 4 deletions

View File

@ -40,6 +40,27 @@ class NoticeController extends Controller
]);
}
public function show(Request $request)
{
if (empty($request->input('id'))) {
abort(500, '参数有误');
}
$notice = Notice::find($request->input('id'));
if (!$notice) {
abort(500, '公告不存在');
}
$notice->show = $notice->show ? 0 : 1;
if (!$notice->save()) {
abort(500, '保存失败');
}
return response([
'data' => true
]);
}
public function drop(Request $request)
{
if (empty($request->input('id'))) {