From e5bf43afdcdb06739b36f87588fc9696f4f62fa0 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 10 Apr 2013 15:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Think/Db/Driver/Pgsql.php | 16 ++++++++-------- Think/Db/Driver/Sqlite.php | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Think/Db/Driver/Pgsql.php b/Think/Db/Driver/Pgsql.php index 6efc0ec8..f46e75a0 100644 --- a/Think/Db/Driver/Pgsql.php +++ b/Think/Db/Driver/Pgsql.php @@ -25,17 +25,17 @@ class Pgsql extends Driver{ * @return array */ public function getFields($tableName) { - $result = $this->query('select fields_name as "Field",fields_type as "Type",fields_not_null as "Null",fields_key_name as "Key",fields_default as "Default",fields_default as "Extra" from table_msg('.$tableName.');'); + $result = $this->query('select fields_name as "field",fields_type as "type",fields_not_null as "null",fields_key_name as "key",fields_default as "default",fields_default as "extra" from table_msg('.$tableName.');'); $info = []; if($result){ foreach ($result as $key => $val) { - $info[$val['Field']] = array( - 'name' => $val['Field'], - 'type' => $val['Type'], - 'notnull' => (bool) ($val['Null'] === ''), // not null is empty, null is yes - 'default' => $val['Default'], - 'primary' => (strtolower($val['Key']) == 'pri'), - 'autoinc' => (strtolower($val['Extra']) == 'auto_increment'), + $info[$val['field']] = array( + 'name' => $val['field'], + 'type' => $val['type'], + 'notnull' => (bool) ($val['null'] === ''), // not null is empty, null is yes + 'default' => $val['default'], + 'primary' => (strtolower($val['key']) == 'pri'), + 'autoinc' => (strtolower($val['extra']) == 'auto_increment'), ); } } diff --git a/Think/Db/Driver/Sqlite.php b/Think/Db/Driver/Sqlite.php index 2021d495..66cf3a86 100644 --- a/Think/Db/Driver/Sqlite.php +++ b/Think/Db/Driver/Sqlite.php @@ -29,13 +29,13 @@ class Sqlite extends Driver { $info = []; if($result){ foreach ($result as $key => $val) { - $info[$val['Field']] = array( - 'name' => $val['Field'], - 'type' => $val['Type'], - 'notnull' => (bool) ($val['Null'] === ''), // not null is empty, null is yes - 'default' => $val['Default'], - 'primary' => (strtolower($val['Key']) == 'pri'), - 'autoinc' => (strtolower($val['Extra']) == 'auto_increment'), + $info[$val['field']] = array( + 'name' => $val['field'], + 'type' => $val['type'], + 'notnull' => (bool) ($val['null'] === ''), // not null is empty, null is yes + 'default' => $val['default'], + 'primary' => (strtolower($val['dey']) == 'pri'), + 'autoinc' => (strtolower($val['extra']) == 'auto_increment'), ); } }