合并分支 'master-server' 到 'master'
gx复制项目脚本 查看合并请求 !1329
正在显示
3 个修改的文件
包含
21 行增加
和
6 行删除
| @@ -119,7 +119,7 @@ class ProjectMenuSeoController extends BaseController | @@ -119,7 +119,7 @@ class ProjectMenuSeoController extends BaseController | ||
| 119 | * @method :post | 119 | * @method :post |
| 120 | * @time :2023/8/3 14:19 | 120 | * @time :2023/8/3 14:19 |
| 121 | */ | 121 | */ |
| 122 | - public function getSonMenu(ProjectMenuSeoLogic $projectMenuSeoLogic){ | 122 | + public function getMenu(ProjectMenuSeoLogic $projectMenuSeoLogic){ |
| 123 | $list = $projectMenuSeoLogic->roleMenuInfo(); | 123 | $list = $projectMenuSeoLogic->roleMenuInfo(); |
| 124 | $this->response('success',Code::SUCCESS,$list); | 124 | $this->response('success',Code::SUCCESS,$list); |
| 125 | } | 125 | } |
| @@ -94,15 +94,30 @@ class ProjectMenuSeoLogic extends BaseLogic | @@ -94,15 +94,30 @@ class ProjectMenuSeoLogic extends BaseLogic | ||
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | /** | 96 | /** |
| 97 | - * @remark :当前菜单下的所有权限子菜单 | 97 | + * @remark :保存时获取菜单 |
| 98 | * @name :roleMenuInfo | 98 | * @name :roleMenuInfo |
| 99 | * @author :lyh | 99 | * @author :lyh |
| 100 | * @method :post | 100 | * @method :post |
| 101 | * @time :2023/8/2 16:24 | 101 | * @time :2023/8/2 16:24 |
| 102 | */ | 102 | */ |
| 103 | - public function roleMenuInfo(){ | ||
| 104 | - $list = $this->model->list(['pid'=>$this->param['id']]); | ||
| 105 | - return $this->success($list); | 103 | + public function roleMenuInfo($id = 0){ |
| 104 | + if(empty($id)){ | ||
| 105 | + $lists = $this->model->list([],'sort'); | ||
| 106 | + }else{ | ||
| 107 | + //排除掉自己+自己的下级 | ||
| 108 | + $lists = $this->model->list(['id'=>['!=',$id],'pid'=>['!=',$id]],'sort'); | ||
| 109 | + } | ||
| 110 | + $menu = array(); | ||
| 111 | + if(!empty($lists)){ | ||
| 112 | + foreach ($lists as $k => $v){ | ||
| 113 | + $v = (array)$v; | ||
| 114 | + if ($v['pid'] == 0) { | ||
| 115 | + $v['sub'] = _get_child($v['id'], $lists); | ||
| 116 | + $menu[] = $v; | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + } | ||
| 120 | + return $this->success($menu); | ||
| 106 | } | 121 | } |
| 107 | 122 | ||
| 108 | /** | 123 | /** |
| @@ -57,7 +57,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -57,7 +57,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 57 | Route::any('/add', [Aside\User\ProjectMenuSeoController::class, 'add'])->name('admin.user_menu_add'); | 57 | Route::any('/add', [Aside\User\ProjectMenuSeoController::class, 'add'])->name('admin.user_menu_add'); |
| 58 | Route::any('/edit', [Aside\User\ProjectMenuSeoController::class, 'edit'])->name('admin.user_menu_edit'); | 58 | Route::any('/edit', [Aside\User\ProjectMenuSeoController::class, 'edit'])->name('admin.user_menu_edit'); |
| 59 | Route::any('/del', [Aside\User\ProjectMenuSeoController::class, 'del'])->name('admin.user_menu_del'); | 59 | Route::any('/del', [Aside\User\ProjectMenuSeoController::class, 'del'])->name('admin.user_menu_del'); |
| 60 | - Route::any('/getSonMenu', [Aside\User\ProjectMenuSeoController::class, 'getSonMenu'])->name('admin.user_menu_getSonMenu'); | 60 | + Route::any('/getMenu', [Aside\User\ProjectMenuSeoController::class, 'getMenu'])->name('admin.user_menu_getSonMenu'); |
| 61 | Route::any('/sort', [Aside\User\ProjectMenuSeoController::class, 'sort'])->name('admin.user_menu_sort'); | 61 | Route::any('/sort', [Aside\User\ProjectMenuSeoController::class, 'sort'])->name('admin.user_menu_sort'); |
| 62 | }); | 62 | }); |
| 63 | //用户组 | 63 | //用户组 |
-
请 注册 或 登录 后发表评论