变更
This commit is contained in:
+10
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user