正在显示
3 个修改的文件
包含
33 行增加
和
0 行删除
| @@ -56,6 +56,25 @@ class TutorialController extends BaseController | @@ -56,6 +56,25 @@ class TutorialController extends BaseController | ||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | /** | 58 | /** |
| 59 | + * @remark :排序 | ||
| 60 | + * @name :sort | ||
| 61 | + * @author :lyh | ||
| 62 | + * @method :post | ||
| 63 | + * @time :2024/5/14 9:39 | ||
| 64 | + */ | ||
| 65 | + public function sort(TutorialLogic $logic){ | ||
| 66 | + $this->request->validate([ | ||
| 67 | + 'id'=>'required', | ||
| 68 | + 'sort'=>'required', | ||
| 69 | + ], [ | ||
| 70 | + 'id.required' => '标识id不为空', | ||
| 71 | + 'sort.required' => '排序sort不为空', | ||
| 72 | + ]); | ||
| 73 | + $data = $logic->sortTutorial(); | ||
| 74 | + $this->response('success',Code::SUCCESS,$data); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + /** | ||
| 59 | * @remark :修改状态 | 78 | * @remark :修改状态 |
| 60 | * @name :status | 79 | * @name :status |
| 61 | * @author :lyh | 80 | * @author :lyh |
| @@ -51,6 +51,19 @@ class TutorialLogic extends BaseLogic | @@ -51,6 +51,19 @@ class TutorialLogic extends BaseLogic | ||
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | /** | 53 | /** |
| 54 | + * @remark :修改状排序 | ||
| 55 | + * @name :statusTutorial | ||
| 56 | + * @author :lyh | ||
| 57 | + * @method :post | ||
| 58 | + * @time :2024/5/13 17:42 | ||
| 59 | + */ | ||
| 60 | + public function sortTutorial(){ | ||
| 61 | + $rs = $this->model->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]); | ||
| 62 | + return $this->success($rs); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + | ||
| 66 | + /** | ||
| 54 | * @remark :删除数据 | 67 | * @remark :删除数据 |
| 55 | * @name :delTutorial | 68 | * @name :delTutorial |
| 56 | * @author :lyh | 69 | * @author :lyh |
| @@ -397,6 +397,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -397,6 +397,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 397 | Route::prefix('tutorial')->group(function () { | 397 | Route::prefix('tutorial')->group(function () { |
| 398 | Route::any('/', [Aside\Com\TutorialController::class, 'lists'])->name('admin.tutorial_lists'); | 398 | Route::any('/', [Aside\Com\TutorialController::class, 'lists'])->name('admin.tutorial_lists'); |
| 399 | Route::any('/save', [Aside\Com\TutorialController::class, 'save'])->name('admin.tutorial_save'); | 399 | Route::any('/save', [Aside\Com\TutorialController::class, 'save'])->name('admin.tutorial_save'); |
| 400 | + Route::any('/sort', [Aside\Com\TutorialController::class, 'sort'])->name('admin.tutorial_sort'); | ||
| 400 | Route::any('/status', [Aside\Com\TutorialController::class, 'status'])->name('admin.tutorial_status'); | 401 | Route::any('/status', [Aside\Com\TutorialController::class, 'status'])->name('admin.tutorial_status'); |
| 401 | Route::any('/del', [Aside\Com\TutorialController::class, 'del'])->name('admin.tutorial_del'); | 402 | Route::any('/del', [Aside\Com\TutorialController::class, 'del'])->name('admin.tutorial_del'); |
| 402 | }); | 403 | }); |
-
请 注册 或 登录 后发表评论