作者 lyh

gx

... ... @@ -48,6 +48,8 @@ class GroupLogic extends BaseLogic
if($rs === false){
$this->fail('error');
}
//更新父类
$this->update_parent($this->param,$this->param['id']);
return $this->success();
}
... ... @@ -70,8 +72,10 @@ class GroupLogic extends BaseLogic
*/
public function group_del(){
//查看当前是否拥有父类
$info = $this->model->read(['id'=>$this->param['id']]);
if($info['pid'])
$info = $this->model->read(['pid'=>$this->param['id']]);
if($info !== false){
$this->fail('当前删除组织拥有下级组织,不允许删除');
}
$rs = $this->model->del($this->param);
if($rs === false){
$this->fail('error');
... ... @@ -85,8 +89,11 @@ class GroupLogic extends BaseLogic
* @method :post
* @time :2023/5/17 9:22
*/
public function add_update_parent($param){
//查询当前添加组是否拥有父类
public function update_parent($param,$id = ''){
if(!empty($id)){
$param = $this->model->read(['id'=>$id]);
}
//查询当前组是否拥有父类
if($param['pid'] != 0){
$parent_info = $this->model->read(['id'=>$param['pid']]);
//把添加成员合并到上级
... ... @@ -104,13 +111,4 @@ class GroupLogic extends BaseLogic
return $this->success($rs);
}
/**
* @name :(删除)del_update_parent
* @author :lyh
* @method :post
* @time :2023/5/17 9:56
*/
public function del_update_parent(){
}
}
... ...