protected function xiajiGrouprs($parentid,$data=[]){
//查找上级的返点
$where['parentid'] = $parentid;
$where1=formatWhere($where);
DailiglModel::where($where1)->chunk(100, function($users)
{
foreach ($users as $user)
{
$data[]=$user->id;
$arr = $this->xiajiGrouprs($user->id);
$data=array_merge($data,$arr);
}
});
return $data;
}
数据库里1万多条数据 ,这个逻辑是查询代理下级的下级的下级的下级......
最佳答案
