修复数据库备份与恢复

This commit is contained in:
2020-04-11 13:43:12 +08:00
parent 495a1b9b8b
commit b03606abd7
3 changed files with 121 additions and 3 deletions

View File

@@ -59,19 +59,22 @@ class Database extends Base {
}
}
$title = '数据还原';
$require = ['jsname' => 'database', 'actionname' => 'import'];
break;
/* 数据备份 */
case 'export':
$list = \think\facade\Db::query('SHOW TABLE STATUS');
$list = array_map('array_change_key_case', $list);
$title = '数据备份';
$require = ['jsname' => 'database', 'actionname' => 'export'];
break;
default:
return $this->error('参数错误!');
}
//渲染模板
$this->data = [
'meta_title' => $type == 'import' ? "数据库恢复" : "数据库备份",
'meta_title' => $type == 'import' ? "数据库恢复" : "数据库备份",
'require' => $require,
'list' => $list
];
return $this->fetch($type);