更新菜单
This commit is contained in:
parent
a05b316e02
commit
138e50c86c
@ -53,6 +53,18 @@ class MenuController extends BaseAdminController
|
|||||||
return $this->dataLists(new MenuLists());
|
return $this->dataLists(new MenuLists());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id获取模块菜单
|
||||||
|
*/
|
||||||
|
public function model_menu_lists()
|
||||||
|
{
|
||||||
|
$id=$this->request->param('id',0);
|
||||||
|
if($id==0){
|
||||||
|
return $this->fail('缺少参数');
|
||||||
|
}
|
||||||
|
$list=MenuLogic::getModelList($id);
|
||||||
|
return $this->success('操作成功', $list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 菜单详情
|
* @notes 菜单详情
|
||||||
|
@ -63,16 +63,22 @@ class MenuLogic extends BaseLogic
|
|||||||
return linear_to_tree($menu, 'children');
|
return linear_to_tree($menu, 'children');
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static function getPidMyList($pid){
|
public static function getModelList($id){
|
||||||
// $where = [];
|
$where = [];
|
||||||
// $where[] = ['type', 'in', ['M', 'C']];
|
$where[] = ['is_disable', '=', 0];
|
||||||
// $where[] = ['is_disable', '=', 0];
|
$where[] = ['id', '=', $id];
|
||||||
// $where[] = ['pid', '=', $pid];
|
$model_name = SystemMenu::where($where)->value('paths');
|
||||||
// $menu = SystemMenu::where($where)
|
if($model_name){
|
||||||
// ->order(['sort' => 'desc', 'id' => 'asc'])
|
unset($where[1]);
|
||||||
// ->select();
|
$where[] = ['type', 'in', ['M', 'C']];
|
||||||
|
$where[] = ['model_name', '=', $model_name];
|
||||||
// }
|
$menu = SystemMenu::where($where)
|
||||||
|
->order(['sort' => 'desc', 'id' => 'asc'])
|
||||||
|
->select();
|
||||||
|
return linear_to_tree($menu, 'children','id','pid',$id);
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @notes 添加菜单
|
* @notes 添加菜单
|
||||||
|
Loading…
x
Reference in New Issue
Block a user