From 4acbc4077d57aa40bcaadeaad958f67a6da557df Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 6 Jul 2016 19:12:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Model=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index 63122af5..886c4e0f 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -172,7 +172,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess { if (!is_null($relation)) { // 执行关联查询 - return $this->db->relation($relation); + return $this->db()->relation($relation); } // 获取关联对象实例 @@ -578,7 +578,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess // 检测字段 if (!empty($this->field)) { if (true === $this->field) { - $this->field = $this->db->getTableInfo('', 'fields'); + $this->field = $this->db()->getTableInfo('', 'fields'); } foreach ($this->data as $key => $val) { if (!in_array($key, $this->field)) {