变更
This commit is contained in:
+2
-1
@@ -21,7 +21,8 @@ class HasCount extends HasBase
|
|||||||
public function __call($name, $arguments)
|
public function __call($name, $arguments)
|
||||||
{
|
{
|
||||||
if (!method_exists($this, $name)) {
|
if (!method_exists($this, $name)) {
|
||||||
$this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
$key = $this->model::className() . '_' . $this->primaryId . '_' . $this->value;
|
||||||
|
$this->_relation->getQuery($key)->$name(...$arguments);
|
||||||
} else {
|
} else {
|
||||||
call_user_func([$this, $name], ...$arguments);
|
call_user_func([$this, $name], ...$arguments);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -29,7 +29,8 @@ class HasMany extends HasBase
|
|||||||
public function __call($name, $arguments)
|
public function __call($name, $arguments)
|
||||||
{
|
{
|
||||||
if (!method_exists($this, $name)) {
|
if (!method_exists($this, $name)) {
|
||||||
$this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
$key = $this->model::className() . '_' . $this->primaryId . '_' . $this->value;
|
||||||
|
$this->_relation->getQuery($key)->$name(...$arguments);
|
||||||
} else {
|
} else {
|
||||||
call_user_func([$this, $name], ...$arguments);
|
call_user_func([$this, $name], ...$arguments);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -28,7 +28,8 @@ class HasOne extends HasBase
|
|||||||
public function __call($name, $arguments)
|
public function __call($name, $arguments)
|
||||||
{
|
{
|
||||||
if (!method_exists($this, $name)) {
|
if (!method_exists($this, $name)) {
|
||||||
$this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
$key = $this->model::className() . '_' . $this->primaryId . '_' . $this->value;
|
||||||
|
$this->_relation->getQuery($key)->$name(...$arguments);
|
||||||
} else {
|
} else {
|
||||||
call_user_func([$this, $name], ...$arguments);
|
call_user_func([$this, $name], ...$arguments);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user