时间:2021-07-01 10:21:17 帮助过:4人阅读
SELECT * from good
ORDER BY series
static function GetTree($depth, $parentID, $nodeID)
{
$str = "";
$nodes = D_node::GetListAll("where parentid=" . $parentID . "", "orderflag desc");
if (count($nodes) > 0) {
foreach ($nodes as $node) {
$str .= self::GetPrefixString($depth) . $node->nodename;
$str .= self::GetTree($depth + 1, $node->id, $nodeID);
}
}
return $str;
}
static function GetPrefixString($depth)
{
$str = "--";
for ($i = 0; $i < $depth; $i++) {
$str .= "--";
}
return $str;
}