This commit is contained in:
2022-09-29 22:51:41 +08:00
parent 7554f6b161
commit f87a3c386f
4 changed files with 32 additions and 63 deletions
-16
View File
@@ -13,22 +13,6 @@ use Exception;
class HasCount extends HasBase
{
/**
* @param $name
* @param $arguments
* @return static
*/
public function __call($name, $arguments)
{
if (!method_exists($this, $name)) {
$key = $this->model::className() . '_' . $this->primaryId . '_' . $this->value;
$this->_relation->getQuery($key)->$name(...$arguments);
} else {
call_user_func([$this, $name], ...$arguments);
}
return $this;
}
/**
* @return array|null|ModelInterface
* @throws Exception