From 9a308b94e3d1a022c3c072a259f280420b813039 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 29 Jan 2017 17:01:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BQuery=E7=B1=BBdelete=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E7=BC=93=E5=AD=98=E6=A0=87=E8=AF=86=E8=AF=BB?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index cd81a08b..b6b8828e 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -2565,6 +2565,7 @@ class Query { // 分析查询表达式 $options = $this->parseExpress(); + $pk = $this->getPk($options); if (isset($options['cache']) && is_string($options['cache']['key'])) { $key = $options['cache']['key']; } @@ -2576,6 +2577,8 @@ class Query } // AR模式分析主键条件 $this->parsePkWhere($data, $options); + } elseif (is_string($pk) && isset($options['where']['AND'][$pk]) && is_scalar($options['where']['AND'][$pk])) { + $key = 'think:' . $options['table'] . '|' . $options['where']['AND'][$pk]; } if (true !== $data && empty($options['where'])) {