mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
modified 格式化代码
This commit is contained in:
parent
819d958c5b
commit
76568c334b
@ -101,14 +101,15 @@ class Tools {
|
|||||||
* 将二维数组变成指定key
|
* 将二维数组变成指定key
|
||||||
* @param $array
|
* @param $array
|
||||||
* @param $keyName
|
* @param $keyName
|
||||||
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
|
||||||
* @return array
|
* @return array
|
||||||
|
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
||||||
*/
|
*/
|
||||||
public static function buildArrByNewKey($array, $keyName = 'id') {
|
public static function buildArrByNewKey($array, $keyName = 'id') {
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ($array as $item) {
|
foreach ($array as $item) {
|
||||||
$list[$item[$keyName]] = $item;
|
$list[$item[$keyName]] = $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,6 +141,7 @@ class Tools {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tree;
|
return $tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,6 +165,7 @@ class Tools {
|
|||||||
$formatTree = array_merge($formatTree, $middle);
|
$formatTree = array_merge($formatTree, $middle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $formatTree;
|
return $formatTree;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user