From 285eb470f103b6168f55cfa1b58f8bbbdcb82131 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 9 Aug 2016 14:14:12 +0800 Subject: [PATCH] =?UTF-8?q?Model=E7=B1=BB=E7=9A=84hasWhere=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=94=AF=E6=8C=81hasone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/library/think/Model.php b/library/think/Model.php index a6c7341c..e8702b9e 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1105,6 +1105,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $model = new static(); $info = $model->$relation()->getRelationInfo(); switch ($info['type']) { + case Relation::HAS_ONE: case Relation::HAS_MANY: $table = $info['model']::getTable(); if (is_array($where)) {