作者 lyh

gx

@@ -114,6 +114,9 @@ class ComController extends BaseController @@ -114,6 +114,9 @@ class ComController extends BaseController
114 * @time :2023/9/6 11:30 114 * @time :2023/9/6 11:30
115 */ 115 */
116 public function getIsHome(){ 116 public function getIsHome(){
  117 + if(isset($this->user['manager_id'])){
  118 + return 1;
  119 + }
117 $deployBuild = new DeployBuild(); 120 $deployBuild = new DeployBuild();
118 $info = $deployBuild->read(['project_id'=>$this->user['project_id']]); 121 $info = $deployBuild->read(['project_id'=>$this->user['project_id']]);
119 if(!empty($info['configuration'])){ 122 if(!empty($info['configuration'])){
@@ -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');