From 774736f41c1f75af73042e77634224def80fb8c6 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 11 Dec 2015 21:36:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3sqlite=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/driver/sqlite.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/think/db/driver/sqlite.php b/library/think/db/driver/sqlite.php index fb70c959..d2ae2401 100644 --- a/library/think/db/driver/sqlite.php +++ b/library/think/db/driver/sqlite.php @@ -43,13 +43,13 @@ class Sqlite extends Driver $info = []; if ($result) { foreach ($result as $key => $val) { - $info[$val['field']] = [ - 'name' => $val['field'], + $info[$val['name']] = [ + 'name' => $val['name'], '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'), + 'notnull' => (bool) (1 === $val['notnull']), + 'default' => $val['dflt_value'], + 'primary' => '1' == $val['pk'], + 'autoinc' => false, ]; } }