diff --git a/library/think/Model.php b/library/think/Model.php index e9ff5205..67079f43 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1139,6 +1139,8 @@ class Model if (isset($pk)) { // 设置主键 $this->pk = count($pk) > 1 ? $pk : $pk[0]; + } else { + $this->pk = null; } // 记录字段类型信息 $this->fields['_type'] = $type;