mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
改进
This commit is contained in:
@@ -172,7 +172,8 @@ class BelongsTo extends OneToOne
|
|||||||
{
|
{
|
||||||
$localKey = $this->localKey;
|
$localKey = $this->localKey;
|
||||||
$foreignKey = $this->foreignKey;
|
$foreignKey = $this->foreignKey;
|
||||||
$data = $this->eagerlyWhere($this->query, [$localKey => $result->$foreignKey], $localKey, $relation, $subRelation, $closure);
|
$this->query->removeWhereField($localKey);
|
||||||
|
$data = $this->eagerlyWhere($this->query, [$localKey => $result->$foreignKey], $localKey, $relation, $subRelation, $closure);
|
||||||
// 关联模型
|
// 关联模型
|
||||||
if (!isset($data[$result->$foreignKey])) {
|
if (!isset($data[$result->$foreignKey])) {
|
||||||
$relationModel = null;
|
$relationModel = null;
|
||||||
|
|||||||
@@ -173,7 +173,8 @@ class HasOne extends OneToOne
|
|||||||
{
|
{
|
||||||
$localKey = $this->localKey;
|
$localKey = $this->localKey;
|
||||||
$foreignKey = $this->foreignKey;
|
$foreignKey = $this->foreignKey;
|
||||||
$data = $this->eagerlyWhere($this, [$foreignKey => $result->$localKey], $foreignKey, $relation, $subRelation, $closure);
|
$this->query->removeWhereField($foreignKey);
|
||||||
|
$data = $this->eagerlyWhere($this->query, [$foreignKey => $result->$localKey], $foreignKey, $relation, $subRelation, $closure);
|
||||||
|
|
||||||
// 关联模型
|
// 关联模型
|
||||||
if (!isset($data[$result->$localKey])) {
|
if (!isset($data[$result->$localKey])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user