mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 17:31:49 +08:00 
			
		
		
		
	update
This commit is contained in:
		| @@ -43,6 +43,9 @@ class TutorialController extends Controller | ||||
|             abort(500, '参数有误'); | ||||
|         } | ||||
|         $tutorial = Tutorial::find($request->input('id')); | ||||
|         if (!$tutorial) { | ||||
|             abort(500, '教程不存在'); | ||||
|         } | ||||
|         $tutorial->show = $tutorial->show ? 0 : 1; | ||||
|         if (!$tutorial->save()) { | ||||
|             abort(500, '保存失败'); | ||||
| @@ -52,4 +55,21 @@ class TutorialController extends Controller | ||||
|             'data' => true | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     public function drop (Request $request) { | ||||
|         if (empty($request->input('id'))) { | ||||
|             abort(500, '参数有误'); | ||||
|         } | ||||
|         $tutorial = Tutorial::find($request->input('id')); | ||||
|         if (!$tutorial) { | ||||
|             abort(500, '教程不存在'); | ||||
|         } | ||||
|         if (!$tutorial->delete()) { | ||||
|             abort(500, '删除失败'); | ||||
|         } | ||||
|  | ||||
|         return response([ | ||||
|             'data' => true | ||||
|         ]); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user