变更
This commit is contained in:
+1
-17
@@ -21,22 +21,6 @@ use Exception;
|
||||
class HasMany 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|Collection
|
||||
* @throws Exception
|
||||
@@ -44,6 +28,6 @@ class HasMany extends HasBase
|
||||
public function get(): array|Collection|null
|
||||
{
|
||||
$key = $this->model::className() . '_' . $this->primaryId . '_' . $this->value;
|
||||
return $this->_relation->get($key);
|
||||
return $this->_relation->get(md5($key));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user