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