From 0cbfb498109f77edaf0855705b9f39054fd5016f Mon Sep 17 00:00:00 2001
From: sugar1569
Date: Thu, 27 Sep 2018 19:55:51 +0800
Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=87=E4=BB=BD=E8=A1=A8?=
=?UTF-8?q?=E8=AF=A6=E6=83=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/system/SystemDatabackup.php | 37 ++++++++++++++++++-
.../view/system/system_databackup/index.php | 2 +-
2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/application/admin/controller/system/SystemDatabackup.php b/application/admin/controller/system/SystemDatabackup.php
index 17d35c78..36ba5f71 100644
--- a/application/admin/controller/system/SystemDatabackup.php
+++ b/application/admin/controller/system/SystemDatabackup.php
@@ -6,6 +6,7 @@ use think\Request;
use service\JsonService as Json;
use \tp5er\Backup;
use think\Session;
+use think\Db;
/**
* 文件校验控制器
* Class SystemDatabackup
@@ -49,7 +50,41 @@ class SystemDatabackup extends AuthController
*/
public function seetable(Request $request = null)
{
- parent::__construct($request);
+ $database = config("database.database");
+ $tablename = $request->param('tablename');
+ $res = Db::query("select * from information_schema.columns where table_name = '".$tablename."' and table_schema = '".$database."'" );
+ $html = '';
+ $html .= '';
+ $html .= '| 字段名 | 数据类型 | 默认值 | 允许非空 | 自动递增 | 备注 |
';
+ $html .= '';
+ foreach($res AS $f)
+ {
+ $html .= '' . $f['COLUMN_NAME'] . ' | ';
+ $html .= '' . $f['COLUMN_TYPE'] . ' | ';
+ $html .= '' . $f['COLUMN_DEFAULT'] . ' | ';
+ $html .= '' . $f['IS_NULLABLE'] . ' | ';
+ $html .= '' . ($f['EXTRA'] == 'auto_increment'?'是':' ') . ' | ';
+ $html .= '' . $f['COLUMN_COMMENT'] . ' | ';
+ $html .= '';
+ }
+ $html .= '
';
+ $html .= '总共:' . count($res) . '个字段
';
+ $html .= '