From 306ce289c4b256a4c79d54c9af6e4473f2cc6414 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 31 Aug 2017 18:09:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BModel=E7=B1=BB=E7=9A=84save?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=AF=B9sequence=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/think/Model.php b/library/think/Model.php index f1d28155..4c3fb205 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -933,6 +933,11 @@ abstract class Model implements \JsonSerializable, \ArrayAccess */ public function save($data = [], $where = [], $sequence = null) { + if (is_string($data)) { + $sequence = $data; + $data = []; + } + if (!empty($data)) { // 数据自动验证 if (!$this->validateData($data)) {