From 8027effa8c96be090384b667b6660fc9ac02b090 Mon Sep 17 00:00:00 2001 From: xl Date: Wed, 23 Oct 2024 14:51:09 +0800 Subject: [PATCH] eee --- Relation.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Relation.php b/Relation.php index 80e2faa..38512ac 100644 --- a/Relation.php +++ b/Relation.php @@ -57,9 +57,7 @@ class Relation extends Component if (Context::exists($_identification)) { return Context::get($_identification); } - $activeModel = $this->_query[$_identification]->first(); - unset($this->_query[$_identification]); - return Context::set($_identification, $activeModel); + return Context::set($_identification, $this->_query[$_identification]->first()); } @@ -72,9 +70,7 @@ class Relation extends Component if (Context::exists($_identification)) { return Context::get($_identification); } - $activeModel = $this->_query[$_identification]->count(); - unset($this->_query[$_identification]); - return Context::set($_identification, $activeModel); + return Context::set($_identification, $this->_query[$_identification]->count()); } @@ -88,9 +84,7 @@ class Relation extends Component if (Context::exists($_identification)) { return Context::get($_identification); } - $activeModel = $this->_query[$_identification]->get(); - unset($this->_query[$_identification]); - return Context::set($_identification, $activeModel); + return Context::set($_identification, $this->_query[$_identification]->get()); } }