mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-07 18:42:49 +08:00
增加测试机制;完善DebugMysql日志逻辑;更新debug_log表字段格式;发布新版本
This commit is contained in:
@@ -167,9 +167,9 @@ if (!function_exists('auth')) {
|
||||
* auth权限验证
|
||||
* @param $node
|
||||
* @return bool
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws think\db\exception\DataNotFoundException
|
||||
* @throws think\db\exception\DbException
|
||||
* @throws think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
function auth($node = null)
|
||||
{
|
||||
@@ -321,3 +321,31 @@ function app_file_path($file_path)
|
||||
|
||||
return $app_file_path;
|
||||
}
|
||||
|
||||
function array_to_table($array_tree, $prefix_key = '')
|
||||
{
|
||||
$table = [];
|
||||
|
||||
foreach ($array_tree as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$table = array_merge($table, array_to_table($value, $key . '.'));
|
||||
} else {
|
||||
$table[] = [
|
||||
'key' => $prefix_key . $key,
|
||||
'value' => $value,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $table;
|
||||
}
|
||||
|
||||
function format_bytes($size, $delimiter = '')
|
||||
{
|
||||
$units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
||||
for ($i = 0; $size >= 1024 && $i < 5; $i++) {
|
||||
$size /= 1024;
|
||||
}
|
||||
|
||||
return round($size, 2) . $delimiter . $units[$i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user