日期:2014-05-17 浏览次数:20464 次
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;
}