作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !3120
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :ManageEntryPositionController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/11/3 17:13
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Aside\Manage;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Aside\BaseController;
  14 +use App\Http\Logic\Aside\Manage\ManageEntryPositionLogic;
  15 +use Illuminate\Http\Request;
  16 +
  17 +/**
  18 + * @remark :岗位管理
  19 + * @name :ManageEntryPositionController
  20 + * @author :lyh
  21 + * @method :post
  22 + * @time :2025/11/3 17:13
  23 + */
  24 +class ManageEntryPositionController extends BaseController
  25 +{
  26 + /**
  27 + * @param Request $request
  28 + */
  29 + public function __construct(Request $request)
  30 + {
  31 + parent::__construct($request);
  32 + $this->logic = new ManageEntryPositionLogic();
  33 + }
  34 +
  35 + /**
  36 + * @remark :列表数据
  37 + * @name :lists
  38 + * @author :lyh
  39 + * @method :post
  40 + * @time :2025/11/3 17:20
  41 + */
  42 + public function lists()
  43 + {
  44 + $data = $this->logic->listEntryPosition();
  45 + $this->response('success',Code::SUCCESS,$data);
  46 + }
  47 +
  48 + /**
  49 + * @remark :保存数据
  50 + * @name :save
  51 + * @author :lyh
  52 + * @method :post
  53 + * @time :2025/11/3 17:20
  54 + */
  55 + public function save()
  56 + {
  57 + $this->request->validate([
  58 + 'name'=>'required'
  59 + ],[
  60 + 'name.required' => 'name不能为空'
  61 + ]);
  62 + $data = $this->logic->saveEntryPosition();
  63 + $this->response('success',Code::SUCCESS,$data);
  64 + }
  65 +
  66 + /**
  67 + * @remark :删除数据
  68 + * @name :del
  69 + * @author :lyh
  70 + * @method :post
  71 + * @time :2025/11/3 17:20
  72 + */
  73 + public function del()
  74 + {
  75 + $this->request->validate([
  76 + 'id'=>'required|array'
  77 + ],[
  78 + 'id.required' => 'ID不能为空'
  79 + ]);
  80 + $data = $this->logic->delEntryPosition();
  81 + $this->response('success',Code::SUCCESS,$data);
  82 + }
  83 +}
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :ManageEntryPositionLogic.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/11/3 17:14
  8 + */
  9 +
  10 +namespace App\Http\Logic\Aside\Manage;
  11 +
  12 +use App\Http\Logic\Aside\BaseLogic;
  13 +use App\Models\Manage\EntryPosition;
  14 +
  15 +class ManageEntryPositionLogic extends BaseLogic
  16 +{
  17 + public function __construct()
  18 + {
  19 + parent::__construct();
  20 + $this->param = $this->requestAll;
  21 + $this->model = new EntryPosition();
  22 + }
  23 +
  24 + /**
  25 + * @remark :列表数据
  26 + * @name :listEntryPosition
  27 + * @author :lyh
  28 + * @method :post
  29 + * @time :2025/11/3 17:27
  30 + */
  31 + public function listEntryPosition($map = [],$page = 1, $row = 10,$order = 'id')
  32 + {
  33 + $data = $this->model->lists($map,$page,$row,$order);
  34 + return $this->success($data);
  35 + }
  36 +
  37 + /**
  38 + * @remark :保存数据
  39 + * @name :saveEntryPosition
  40 + * @author :lyh
  41 + * @method :post
  42 + * @time :2025/11/3 17:28
  43 + */
  44 + public function saveEntryPosition()
  45 + {
  46 + try {
  47 + if(isset($this->param['id']) && !empty($this->param['id'])){
  48 + $id = $this->param['id'];
  49 + $this->model->edit($this->param,['id'=>$id]);
  50 + }else{
  51 + $id = $this->model->addReturnId($this->param);
  52 + }
  53 + }catch (\Exception $e){
  54 + $this->fail('保存失败,请联系管理员'.$e->getMessage());
  55 + }
  56 + return $this->success(['id'=>$id]);
  57 + }
  58 +
  59 + /**
  60 + * @remark :删除数据
  61 + * @name :delEntryPosition
  62 + * @author :lyh
  63 + * @method :post
  64 + * @time :2025/11/3 17:28
  65 + */
  66 + public function delEntryPosition()
  67 + {
  68 + $this->model->del(['id'=>['in',$this->param['id']]]);
  69 + return $this->success();
  70 + }
  71 +}
@@ -32,6 +32,9 @@ class SettingFaqLogic extends BaseLogic @@ -32,6 +32,9 @@ class SettingFaqLogic extends BaseLogic
32 public function getRouteList($map = []) 32 public function getRouteList($map = [])
33 { 33 {
34 $routeModel = new RouteMap(); 34 $routeModel = new RouteMap();
  35 + if(!empty($map['route'])){
  36 + $map['route'] = ['like','%'.$map['route'].'%'];
  37 + }
35 $list = $routeModel->list($map,'id',['*'],'desc',20); 38 $list = $routeModel->list($map,'id',['*'],'desc',20);
36 return $this->success($list); 39 return $this->success($list);
37 } 40 }
@@ -5,7 +5,7 @@ namespace App\Models\Manage; @@ -5,7 +5,7 @@ namespace App\Models\Manage;
5 use App\Models\Base; 5 use App\Models\Base;
6 6
7 /** 7 /**
8 - * @remark : 8 + * @remark :岗位管理
9 * @class :EntryPosition.php 9 * @class :EntryPosition.php
10 * @author :lyh 10 * @author :lyh
11 * @time :2023/7/22 18:08 11 * @time :2023/7/22 18:08
@@ -679,7 +679,12 @@ Route::middleware(['aloginauth'])->group(function () { @@ -679,7 +679,12 @@ Route::middleware(['aloginauth'])->group(function () {
679 Route::any('/save', [Aside\Ticket\TicketUploadDataController::class,'save'])->name('ticket_upload_save'); 679 Route::any('/save', [Aside\Ticket\TicketUploadDataController::class,'save'])->name('ticket_upload_save');
680 Route::any('/detail', [Aside\Ticket\TicketUploadDataController::class,'detail'])->name('ticket_upload_detail'); 680 Route::any('/detail', [Aside\Ticket\TicketUploadDataController::class,'detail'])->name('ticket_upload_detail');
681 }); 681 });
682 - 682 + //
  683 + Route::prefix('entry_position')->group(function () {
  684 + Route::any('/', [Aside\Manage\ManageEntryPositionController::class,'lists'])->name('entry_position_lists');
  685 + Route::any('/save', [Aside\Manage\ManageEntryPositionController::class,'save'])->name('entry_position_save');
  686 + Route::any('/del', [Aside\Manage\ManageEntryPositionController::class,'del'])->name('entry_position_del');
  687 + });
683 688
684 }); 689 });
685 690