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)'); } }