请问老师,我是在TP框架里自定义的这个方法,调用时为何查询结果打印出来是null,请问是哪里条件有问题吗?
代码如下: public function getTree($pid=0){ $data=$this->where('pid='.$pid)->select(); foreach($data as &$cate){ $cate['sons']=$this->getTree($cate['id']); } return $data; }
代码如下: public function getTree($pid=0){ $data=$this->where('pid='.$pid)->select(); foreach($data as &$cate){ $cate['sons']=$this->getTree($cate['id']); } return $data; }
2014-11-17
举报