|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :ProjectMenuSeoController.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/4 15:28
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Aside\User;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Aside\BaseController;
|
|
|
|
use App\Http\Logic\Aside\User\ProjectMenuSeoLogic;
|
|
|
|
use App\Models\User\ProjectMenuSeo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :设置白帽菜单
|
|
|
|
* @name :ProjectMenuSeoController
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/4 15:28
|
|
|
|
*/
|
|
|
|
class ProjectMenuSeoController extends BaseController
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @remark :白帽菜单列表
|
|
|
|
* @name :lists
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/4 15:33
|
|
|
|
*/
|
|
|
|
public function lists(ProjectMenuSeo $projectMenuSeo){
|
|
|
|
$lists = $projectMenuSeo->list($this->map,'sort');
|
|
|
|
$menu = array();
|
|
|
|
foreach ($lists as $k => $v){
|
|
|
|
$v = (array)$v;
|
|
|
|
if ($v['pid'] == 0) {
|
|
|
|
$v['sub'] = _get_child($v['id'], $lists);
|
|
|
|
$menu[] = $v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$menu);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取白帽详情
|
|
|
|
* @name :info
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/4 15:34
|
|
|
|
*/
|
|
|
|
public function info(ProjectMenuSeo $projectMenuSeo){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required'
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空'
|
|
|
|
]);
|
|
|
|
$info = $projectMenuSeo->read($this->param);
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :添加菜单
|
|
|
|
* @name :add
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/4 15:38
|
|
|
|
*/
|
|
|
|
public function add(ProjectMenuSeoLogic $projectMenuSeoLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'name'=>'required'
|
|
|
|
],[
|
|
|
|
'name.required' => '名称不能为空'
|
|
|
|
]);
|
|
|
|
$projectMenuSeoLogic->menu_add();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :编辑菜单
|
|
|
|
* @name :edit
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/4 15:42
|
|
|
|
*/
|
|
|
|
public function edit(ProjectMenuSeoLogic $projectMenuSeoLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'name'=>'required'
|
|
|
|
],[
|
|
|
|
'name.required' => '名称不能为空'
|
|
|
|
]);
|
|
|
|
$projectMenuSeoLogic->menu_edit();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :删除菜单
|
|
|
|
* @name :del
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/4 15:43
|
|
|
|
*/
|
|
|
|
public function del(ProjectMenuSeoLogic $projectMenuSeoLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>['required','array'],
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空',
|
|
|
|
'id.array' => 'ID为数组',
|
|
|
|
]);
|
|
|
|
$projectMenuSeoLogic->menu_del();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取子菜单
|
|
|
|
* @name :getSonMenu
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/3 14:19
|
|
|
|
*/
|
|
|
|
public function getSonMenu(ProjectMenuSeoLogic $projectMenuSeoLogic){
|
|
|
|
$list = $projectMenuSeoLogic->roleMenuInfo();
|
|
|
|
$this->response('success',Code::SUCCESS,$list);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :排序
|
|
|
|
* @name :setSort
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/10 16:40
|
|
|
|
*/
|
|
|
|
public function sort(ProjectMenuSeoLogic $projectMenuSeoLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required',
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空',
|
|
|
|
]);
|
|
|
|
$projectMenuSeoLogic->setParamStatus();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|