Revert "改名"
This reverts commit fdf58326
This commit is contained in:
+4
-4
@@ -3,8 +3,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Database;
|
||||
|
||||
use Exception;
|
||||
use Database\Traits\HasBase;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class HasCount
|
||||
@@ -21,10 +21,10 @@ class HasCount extends HasBase
|
||||
*/
|
||||
public function __call($name, $arguments)
|
||||
{
|
||||
if (method_exists($this, $name)) {
|
||||
return call_user_func([$this, $name], ...$arguments);
|
||||
if (!method_exists($this, $name)) {
|
||||
return $this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
||||
}
|
||||
return $this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
||||
return call_user_func([$this, $name], ...$arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+5
-4
@@ -6,10 +6,11 @@
|
||||
* Time: 13:58
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Database;
|
||||
|
||||
use Exception;
|
||||
use Database\Traits\HasBase;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class HasMany
|
||||
@@ -27,10 +28,10 @@ class HasMany extends HasBase
|
||||
*/
|
||||
public function __call($name, $arguments)
|
||||
{
|
||||
if (method_exists($this, $name)) {
|
||||
return call_user_func([$this, $name], ...$arguments);
|
||||
if (!method_exists($this, $name)) {
|
||||
return $this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
||||
}
|
||||
return $this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
||||
return call_user_func([$this, $name], ...$arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-4
@@ -27,11 +27,10 @@ class HasOne extends HasBase
|
||||
*/
|
||||
public function __call($name, $arguments)
|
||||
{
|
||||
if (method_exists($this, $name)) {
|
||||
return call_user_func([$this, $name], ...$arguments);
|
||||
if (!method_exists($this, $name)) {
|
||||
return $this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
||||
}
|
||||
$this->_relation->getQuery($this->model::className())->$name(...$arguments);
|
||||
return $this;
|
||||
return call_user_func([$this, $name], ...$arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user