This commit is contained in:
2021-01-16 16:57:35 +08:00
parent b9dbba1dd5
commit eb622b8527
3 changed files with 19 additions and 14 deletions
+6 -4
View File
@@ -15,13 +15,15 @@ class HasCount extends HasBase
/**
* @param $name
* @param $arguments
* @return $this
* @return ActiveQuery
* @throws Exception
*/
public function __call($name, $arguments): static
public function __call($name, $arguments): mixed
{
$this->_relation->getQuery($this->model::className())->$name(...$arguments);
return $this;
if (method_exists($this, $name)) {
return call_user_func([$this, $name], ...$arguments);
}
return $this->_relation->getQuery($this->model::className())->$name(...$arguments);
}
/**