Merge remote-tracking branch 'origin/master' into akun
正在显示
1 个修改的文件
包含
5 行增加
和
8 行删除
| @@ -133,14 +133,11 @@ class NavLogic extends BaseLogic | @@ -133,14 +133,11 @@ class NavLogic extends BaseLogic | ||
| 133 | */ | 133 | */ |
| 134 | public function navDelete() | 134 | public function navDelete() |
| 135 | { | 135 | { |
| 136 | - //判断当前菜单是否拥有下级 | ||
| 137 | - $info = $this->model->read(['pid'=>$this->param['id']]); | ||
| 138 | - if($info !== false){ | ||
| 139 | - $this->fail('当前菜单存在下级,不允许删除'); | ||
| 140 | - } | ||
| 141 | - $rs = $this->model->del($this->param); | ||
| 142 | - if($rs === false){ | ||
| 143 | - $this->fail('error'); | 136 | + $str = []; |
| 137 | + //排序掉当前id下所有子集 | ||
| 138 | + $str = $this->getAllSub($this->param['id'], $str); | ||
| 139 | + foreach ($str as $v){ | ||
| 140 | + $this->model->del(['id'=>$v]); | ||
| 144 | } | 141 | } |
| 145 | //编辑菜单后,通知更新 | 142 | //编辑菜单后,通知更新 |
| 146 | $this->addUpdateNotify(RouteMap::SOURCE_NAV, 'all'); | 143 | $this->addUpdateNotify(RouteMap::SOURCE_NAV, 'all'); |
-
请 注册 或 登录 后发表评论