From 10ec74c2f7dc377f66a6c15d5f8910607973f8a7 Mon Sep 17 00:00:00 2001 From: topnuomi <1130395124@qq.com> Date: Thu, 28 May 2020 21:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E6=AC=A1=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AF=BC=E8=87=B4=E4=BA=8B?= =?UTF-8?q?=E5=8A=A1=E6=89=A7=E8=A1=8C=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/library/Database.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/framework/library/Database.php b/framework/library/Database.php index 9e67c5a..a71c06b 100644 --- a/framework/library/Database.php +++ b/framework/library/Database.php @@ -121,7 +121,7 @@ class Database */ public static function table($table, $pk = '', $prefix = '') { - $ident = md5($prefix . $table); + $ident = $prefix . $table; if (!isset(self::$instance[$ident])) { self::$instance[$ident] = new self($table, $pk, $prefix); } @@ -136,7 +136,10 @@ class Database */ private function setDriver(DatabaseIfs $driver, $config) { - self::$driver = $driver->connect($config); + if (!self::$driver) { + self::$driver = $driver->connect($config); + } + return self::$driver; } /**