From c88bcf45ade68029fe33c3868ff21a2fa5bc6214 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 15 Jun 2016 11:44:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BB=E7=9A=84column?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20=E6=94=AF=E6=8C=81=20field=E5=92=8Ckey?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/App.php | 2 +- library/think/db/Query.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/library/think/App.php b/library/think/App.php index 7b64581e..0c710b51 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -331,7 +331,7 @@ class App private static function init($module = '') { // 定位模块目录 - $module = ($module) ? $module . DS : ''; + $module = $module ? $module . DS : ''; // 加载初始化文件 if (is_file(APP_PATH . $module . 'init' . EXT)) { diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 566d5446..3bd7aeec 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -447,6 +447,8 @@ class Query $result[$val[$key]] = $val; } elseif (2 == $count) { $result[$val[$key]] = $val[$key2]; + } elseif (1 == $count) { + $result[$val[$key]] = $val[$key1]; } } } else {