From 494b0dce2b1c1a98beac301cf92978a99ee8b109 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 29 Apr 2016 11:14:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BBfind=E5=92=8Cse?= =?UTF-8?q?lect=E6=96=B9=E6=B3=95=E7=9A=84=E7=BC=93=E5=AD=98=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convention.php | 6 ------ library/think/db/Query.php | 13 +++++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/convention.php b/convention.php index 3fe6ed1f..d06ffc9d 100644 --- a/convention.php +++ b/convention.php @@ -29,12 +29,6 @@ return [ 'default_timezone' => 'PRC', // 是否开启多语言 'lang_switch_on' => false, - // 支持的多语言列表 - 'lang_list' => ['zh-cn'], - // 语言变量 - 'lang_detect_var' => 'lang', - // 语言cookie变量 - 'lang_cookie_var' => 'think_lang', // 默认全局过滤方法 用逗号分隔多个 'default_filter' => '', // 自动Response输出 diff --git a/library/think/db/Query.php b/library/think/db/Query.php index f3089ee3..91d48e86 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -1235,10 +1235,7 @@ class Query $sql = $this->builder()->select($options); // 执行查询操作 $resultSet = $this->connection->query($sql, $this->getBind(), $options['fetch_sql'], $options['master'], $options['fetch_pdo']); - } - // 返回结果处理 - if (!empty($resultSet)) { if (is_string($resultSet)) { // 返回SQL return $resultSet; @@ -1252,6 +1249,10 @@ class Query // 缓存数据集 Cache::set($key, $resultSet, $cache['expire']); } + } + + // 返回结果处理 + if (!empty($resultSet)) { // 数据列表读取后的处理 if (!empty($options['model'])) { @@ -1311,10 +1312,7 @@ class Query $sql = $this->builder()->select($options); // 执行查询 $result = $this->connection->query($sql, $this->getBind(), $options['fetch_sql'], $options['master'], $options['fetch_pdo']); - } - // 数据处理 - if (!empty($result)) { if (is_string($result)) { // 返回SQL return $result; @@ -1329,7 +1327,10 @@ class Query // 缓存数据 Cache::set($key, $result, $cache['expire']); } + } + // 数据处理 + if (!empty($result)) { $data = $result[0]; if (!empty($options['model'])) { // 返回模型对象