修改菜单参数问题

This commit is contained in:
Anyon 2020-03-19 11:49:30 +08:00
parent 7e95f7d5bb
commit 3cc6d26b06

View File

@ -104,7 +104,7 @@ class Menu extends Controller
// 选择自己的上级菜单
if (empty($vo['pid']) && $this->request->get('pid', '0')) $vo['pid'] = $this->request->get('pid', '0');
// 列出可选上级菜单
$menus = $this->app->db->name($this->table)->where(['status' => '1'])->order('sort desc,id asc')->column('id,pid,icon,url,title');
$menus = $this->app->db->name($this->table)->where(['status' => '1'])->order('sort desc,id asc')->column('id,pid,icon,url,title,params', 'id');
$this->menus = DataExtend::arr2table(array_merge($menus, [['id' => '0', 'pid' => '-1', 'url' => '#', 'title' => '顶部菜单']]));
if (isset($vo['id'])) foreach ($this->menus as $key => $menu) if ($menu['id'] === $vo['id']) $vo = $menu;
foreach ($this->menus as $key => &$menu) {