Model类的hasWhere方法支持hasone

This commit is contained in:
thinkphp
2016-08-09 14:14:12 +08:00
parent 6a2fda25de
commit 285eb470f1

View File

@@ -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)) {