This commit is contained in:
2020-02-18 17:52:26 +08:00
parent 4c036db815
commit e7cf4849c9
6 changed files with 87 additions and 20 deletions

View File

@@ -27,7 +27,7 @@ class Database extends Admin {
/* 数据还原 */
case 'import':
//列出备份文件列表
$path = config('data_backup_path');
$path = \think\facade\Cache::get('system_config_data.data_backup_path');
if (!is_dir($path)) {
mkdir($path, 0755, true);
}
@@ -63,8 +63,7 @@ class Database extends Admin {
break;
/* 数据备份 */
case 'export':
$Db = \think\Db::connect();
$list = $Db->query('SHOW TABLE STATUS');
$list = \think\facade\Db::query('SHOW TABLE STATUS');
$list = array_map('array_change_key_case', $list);
$title = '数据备份';
break;
@@ -72,8 +71,9 @@ class Database extends Admin {
return $this->error('参数错误!');
}
//渲染模板
$this->setMeta($title);
$this->assign('list', $list);
$this->data = [
'list' => $list
];
return $this->fetch($type);
}