This commit is contained in:
2023-04-01 17:11:47 +08:00
parent 2aec2afc59
commit cd94d2dc57
7 changed files with 67 additions and 61 deletions
+3 -1
View File
@@ -5,6 +5,7 @@ namespace Database;
use Database\Traits\HasBase;
use Exception;
use Kiri;
/**
* Class HasCount
@@ -19,7 +20,8 @@ class HasCount extends HasBase
*/
public function get(): array|ModelInterface|null
{
return $this->_relation->count($this->reKey());
$relation = Kiri::getDi()->get(Relation::class);
return $relation->count($this->name);
}
}