递归操作 节点树

来源:互联网 发布:vs2015 php插件 编辑:程序博客网 时间:2024/05/07 14:10

不建议使用


 /** 查询节点树*/

    protected function getNodeTree($pid=0)
    {
        $node_list = M('book')->where("f_id = $pid")->select();
        foreach($node_list as $key=>$val)
        {
            $node_list[$key]['son']=$this->getNodeTree($val['id']);
        }
        return $node_list;
    }
0 0
原创粉丝点击