Commit 1f064674 by 庄欣

4.23

parent 4367d3b4
...@@ -77,16 +77,16 @@ function getCityName ($id,$field = "city_name") { ...@@ -77,16 +77,16 @@ function getCityName ($id,$field = "city_name") {
} }
function list_to_tree($list, $pk='id', $pid = 'pid', $child = 'child', $root = 0) { function list_to_tree($list, $pk='id', $pid = 'pid', $child = 'child', $root = 0) {
// 创建Tree // ����Tree
$tree = array(); $tree = array();
if(is_array($list)) { if(is_array($list)) {
// 创建基于主键的数组引用 // ����������������������
$refer = array(); $refer = array();
foreach ($list as $key => $data) { foreach ($list as $key => $data) {
$refer[$data[$pk]] =& $list[$key]; $refer[$data[$pk]] =& $list[$key];
} }
foreach ($list as $key => $data) { foreach ($list as $key => $data) {
// 判断是否存在parent // �ж��Ƿ�����parent
$parentId = $data[$pid]; $parentId = $data[$pid];
if ($root == $parentId) { if ($root == $parentId) {
$tree[] =& $list[$key]; $tree[] =& $list[$key];
...@@ -116,9 +116,9 @@ function getChannelList($lists , $pid = 0,$depth = 0 ,$child = "child") { ...@@ -116,9 +116,9 @@ function getChannelList($lists , $pid = 0,$depth = 0 ,$child = "child") {
$html.=">"; $html.=">";
if ($depth > 0) { if ($depth > 0) {
if ($index == $len-1) { if ($index == $len-1) {
$pre = ""; $pre = "��";
}else{ }else{
$pre = ""; $pre = "��";
} }
for ($i=0;$i<$depth;$i++){ for ($i=0;$i<$depth;$i++){
$space .= "&nbsp;&nbsp;"; $space .= "&nbsp;&nbsp;";
...@@ -149,9 +149,9 @@ function getCateList($lists , $pid = 0,$depth = 0 ,$child = "child") { ...@@ -149,9 +149,9 @@ function getCateList($lists , $pid = 0,$depth = 0 ,$child = "child") {
$html.=">"; $html.=">";
if ($depth > 0) { if ($depth > 0) {
if ($index == $len-1) { if ($index == $len-1) {
$pre = ""; $pre = "��";
}else{ }else{
$pre = ""; $pre = "��";
} }
for ($i=0;$i<$depth;$i++){ for ($i=0;$i<$depth;$i++){
$space .= "&nbsp;&nbsp;"; $space .= "&nbsp;&nbsp;";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment