This commit is contained in:
2022-09-29 23:06:07 +08:00
parent 76154631e5
commit 77f63a85ed
5 changed files with 23 additions and 23 deletions
+10 -2
View File
@@ -74,8 +74,7 @@ abstract class HasBase implements \Database\Traits\Relation
{
if (!method_exists($this, $name)) {
$key = $this->model . '_' . $this->primaryId . '_' . $this->value;
var_dump($this->model, $this->primaryId, $this->value);
$this->_relation->getQuery(md5($key))->$name(...$arguments);
$this->_relation->getQuery($this->reKey())->$name(...$arguments);
} else {
call_user_func([$this, $name], ...$arguments);
}
@@ -83,6 +82,15 @@ abstract class HasBase implements \Database\Traits\Relation
}
/**
* @return string
*/
protected function reKey(): string
{
return md5($this->model . '_' . $this->primaryId . '_' . $this->value);
}
/**
* @param $name
* @return mixed