From ba5428e33503d629bc8c9ae288c87eb390a453dd Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 19 Nov 2017 13:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8Bsaveall=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=85=8D=E5=90=88isUpdate=E6=96=B9=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 d7f91db0..6119d964 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1297,7 +1297,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $auto = true; } foreach ($dataSet as $key => $data) { - if (!empty($auto) && isset($data[$pk])) { + if ($this->isUpdate || (!empty($auto) && isset($data[$pk]))) { $result[$key] = self::update($data, [], $this->field); } else { $result[$key] = self::create($data, $this->field);