mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-23 18:00:17 +08:00
added 新增菜单删除
This commit is contained in:
parent
a3ccc69e18
commit
b1fd6a1f56
@ -396,7 +396,18 @@ class Menu extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function del(){
|
public function del(){
|
||||||
$this->error('失败');
|
if( $this->request->isDelete() ){
|
||||||
|
$key = $this->request->delete($this->primaryKey);
|
||||||
|
$childNum = \app\admin\model\Menu::where(['fid' => $key])->count();
|
||||||
|
if( $childNum ){
|
||||||
|
$this->error('当前菜单存在子菜单,删除失败!');
|
||||||
|
}
|
||||||
|
$delNum = \app\admin\model\Menu::destroy($key);
|
||||||
|
if( $delNum ){
|
||||||
|
$this->success('操作成功!', url('Menu/index'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->error('操作失败!');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user