first commit
This commit is contained in:
67
application/system/controller/Database.php
Normal file
67
application/system/controller/Database.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
// +------------------------------------------------+
|
||||
// |http://www.cjango.com |
|
||||
// +------------------------------------------------+
|
||||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||||
// +------------------------------------------------+
|
||||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||||
// +------------------------------------------------+
|
||||
namespace app\system\controller;
|
||||
|
||||
use app\common\service\Database as DatabaseService;
|
||||
|
||||
class Database extends _Init
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
$list = DatabaseService::getTables();
|
||||
$this->assign('list', $list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 备份的方法
|
||||
* @param [type] $tables [description]
|
||||
* @param [type] $id [description]
|
||||
* @param [type] $start [description]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function backup($tables = null, $id = null, $start = null)
|
||||
{
|
||||
$result = DatabaseService::backup($tables, $id, $start);
|
||||
if (is_array($result) && !empty($result)) {
|
||||
return $this->success($result['msg'], '', $result['data']);
|
||||
} else {
|
||||
return $this->error($result);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 备份列表
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
$list = DatabaseService::backupList();
|
||||
$this->assign('list', $list);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除备份文件
|
||||
* @param [type] $time [description]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function del($time)
|
||||
{
|
||||
if (IS_POST && is_array($time)) {
|
||||
$result = DatabaseService::del($time);
|
||||
if ($result === true) {
|
||||
return $this->success('删除成功');
|
||||
} else {
|
||||
return $this->error($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user