<?php
// 引用的外部类及方法参见我的 php-library 项目
function getSubRecur($pid){
global $pdo, $func;
$retData = array();
$curData = array($pid);
while(count($curData)>0){
$curStr = implode(',', $curData);
$sql = "select id from kjj_group_info where pid in ({$curStr})";
$nextData = $pdo->fetchData($sql);
$retData =array_merge($retData, $curData);
$curData =$func->arrayColumn($nextData, 'id');
}
return $retData;
}
?>