This commit is contained in:
2022-09-29 22:38:25 +08:00
parent 322168ff68
commit 7554f6b161
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -21,7 +21,8 @@ class HasCount extends HasBase
public function __call($name, $arguments)
{
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 {
call_user_func([$this, $name], ...$arguments);
}