修正Model类hasWhere方法

This commit is contained in:
thinkphp
2017-02-07 17:39:59 +08:00
parent 7f6102d12e
commit a3a37e6cfa

View File

@@ -1450,7 +1450,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
$model = new static(); $model = new static();
$relation = $model->$relation(); $relation = $model->$relation();
if ($relation instanceof HasMany) { if ($relation instanceof HasMany) {
return $model->$relation()->hasWhere($where); return $relation->hasWhere($where);
} else { } else {
return $relation; return $relation;
} }