From 9903717cc4397cbbb46086073e27f87c4bd65a6d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 27 Jan 2016 16:52:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A1=A8=E6=B2=A1=E6=9C=89=E4=B8=BB=E9=94=AE=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=20getpk=E6=96=B9=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 2 ++ 1 file changed, 2 insertions(+) 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;