From bc1bd1b7423f4eee97bac7ba500938044bd240ae Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 13 Feb 2017 19:02:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BModel=E7=B1=BBdelete=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Model.php b/library/think/Model.php index 42c08410..ebeffbb4 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1081,7 +1081,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess // 删除条件 $pk = $this->getPk(); - if (isset($this->data[$pk])) { + if (is_string($pk) && isset($this->data[$pk])) { $where = [$pk => $this->data[$pk]]; } elseif (!empty($this->updateWhere)) { $where = $this->updateWhere;