删 Delete all sub -nodes of the parent node when deleting the parent node:
where($depth)->field('id')->select();
//查询需要删除的所有子id
if($ids){
$arr=array();
foreach($ids as $key=>$vo){
$arr[]=$vo['id'];
}
}
if($arr){
$str=implode(',', $arr);
$depth['id']=array('in',$str);
$update['status']=0;
$res=$this->where($depth)->save($update);
if($res){
echo '删除成功';
}else{
echo '删除失败';
}
}else{
echo '删除失败';
}
}