X Tutup
Skip to content

Commit 1292b84

Browse files
committed
修正Model类的db方法 直接调用db(1) 出错的问题
1 parent 89256bd commit 1292b84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ThinkPHP/Lib/Core/Model.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ public function db($linkNum='',$config='',$params=array()){
11301130
}
11311131
static $_linkNum = array();
11321132
static $_db = array();
1133-
if(!isset($_db[$linkNum]) || (isset($_db[$linkNum]) && $_linkNum[$linkNum]!=$config) ) {
1133+
if(!isset($_db[$linkNum]) || (isset($_db[$linkNum]) && $config && $_linkNum[$linkNum]!=$config) ) {
11341134
// 创建一个新的实例
11351135
if(!empty($config) && is_string($config) && false === strpos($config,'/')) { // 支持读取配置参数
11361136
$config = C($config);

0 commit comments

Comments
 (0)
X Tutup