application/core/manage/logic/DatabaseLogic.php
public function addBakup($user_id)
    {
        try {
            
            $connection = $this->getConnection();
            $dump = new MySQLDump($connection);
            
            // 备份数据库
            $bakup_path = $this->getBakupPath();
            $file_path = '/dump_' . date('Ymd_His') . '.sql';
            $dump->save($bakup_path . $file_path);
            
            // 备份记录
            $data = [
                'dump_uid' => $user_id,
                'dump_size' => filesize($bakup_path . $file_path),
                'dump_file' => $file_path,
                'dump_time' => time()
            ];
            $this->model->add($data);
            
            return Format::formatResult(1, '备份数据库成功');
        } catch (\Exception $e) {
            return Format::formatResult(0, '备份数据库失败:' . $e->getMessage());
        }
    }
public function addBakup($user_id)
    {
        try {
            
            $connection = $this->getConnection();
            $dump = new MySQLDump($connection);
            
            // 备份数据库
            $bakup_path = $this->getBakupPath();
            $file_path = '/dump_' . date('Ymd_His') . '.sql';
            $dump->save($bakup_path . $file_path);
            
            // 备份记录
            $data = [
                'dump_uid' => $user_id,
                'dump_size' => filesize($bakup_path . $file_path),
                'dump_file' => $file_path,
                'dump_time' => time()
            ];
            $this->model->add($data);
            
            return Format::formatResult(1, '备份数据库成功');
        } catch (\Exception $e) {
            return Format::formatResult(0, '备份数据库失败:' . $e->getMessage());
        }
    }
备份

@param number $user_id
@return array