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
@@ -11,6 +11,7 @@ namespace Database;
use Database\Traits\HasBase;
use Exception;
use Kiri;
/**
* Class HasOne
@@ -26,6 +27,7 @@ class HasOne extends HasBase
*/
public function get(): array|ModelInterface|null
{
return $this->_relation->first($this->reKey());
$relation = Kiri::getDi()->get(Relation::class);
return $relation->first($this->name);
}
}