From fd9b0198401079964eac3b985dc77161509e203e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 9 Apr 2018 11:49:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AD=E5=8C=85=E6=9F=A5=E8=AF=A2=E4=BD=BF?= =?UTF-8?q?=E7=94=A8cache(true)=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/zh-cn.php | 1 + library/think/db/Query.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lang/zh-cn.php b/lang/zh-cn.php index 0c2732f5..c821f9fe 100644 --- a/lang/zh-cn.php +++ b/lang/zh-cn.php @@ -66,6 +66,7 @@ return [ 'relation data not exists' => '关联数据不存在', 'relation not support' => '关联不支持', 'chunk not support order' => 'Chunk不支持调用order方法', + 'closure not support cache(true)' => '使用闭包查询不支持cache(true),请指定缓存Key', // 上传错误信息 'unknown upload error' => '未知上传错误!', diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 96cd8de1..478e1f3c 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -2441,7 +2441,7 @@ class Query try { return md5($prefix . serialize($options) . serialize($bind)); } catch (\Exception $e) { - return; + throw new Exception('closure not support cache(true)'); } }