//递归查询上级
public function getpid($pid,$deploy=0){
static $data=[];
$result=Db::name('users')->where('id',$pid)->find();
if($result['deploy_id']>$deploy){
$data[]=$result;
}
if(count($data)<2){
if($result['pid']){
$this->getpid($result['pid'],$deploy=$result['deploy_id']);
}
}
return $data;
}
递归查询上级
最新推荐文章于 2022-05-30 18:28:09 发布