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'])) { // 返回模型对象