修正一对一关联

This commit is contained in:
thinkphp
2018-02-14 12:11:25 +08:00
parent f80073f9f9
commit 09402cee9b
2 changed files with 3 additions and 1 deletions

View File

@@ -128,6 +128,7 @@ class BelongsTo extends OneToOne
}
if (!empty($range)) {
$this->query->removeWhereField($localKey);
$data = $this->eagerlyWhere($this->query, [
$localKey => [
'in',

View File

@@ -130,7 +130,8 @@ class HasOne extends OneToOne
}
if (!empty($range)) {
$data = $this->eagerlyWhere($this, [
$this->query->removeWhereField($foreignKey);
$data = $this->eagerlyWhere($this->query, [
$foreignKey => [
'in',
$range,