From 4da468b27dc4b51c7f6125f8f7079e2eb7d2fc42 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 9 Aug 2016 17:08:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bdb=E5=8A=A9=E6=89=8B=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=A2=9E=E5=8A=A0=E7=AC=AC=E4=B8=89=E4=B8=AA=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20=E7=94=A8=E4=BA=8E=E8=AE=BE=E7=BD=AE=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=BC=BA=E5=88=B6=E9=87=8D=E6=96=B0=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helper.php b/helper.php index 5c5f8442..f2fd20cb 100644 --- a/helper.php +++ b/helper.php @@ -187,11 +187,12 @@ if (!function_exists('db')) { * 实例化数据库类 * @param string $name 操作的数据表名称(不含前缀) * @param array|string $config 数据库配置参数 + * @param bool $force 是否强制重新连接 * @return \think\db\Query */ - function db($name = '', $config = []) + function db($name = '', $config = [], $force = true) { - return Db::connect($config, true)->name($name); + return Db::connect($config, $force)->name($name); } }