This commit is contained in:
张城铭 2019-01-23 14:53:09 +08:00
parent f155da24c6
commit dd58716577

View File

@ -47,7 +47,7 @@ class Model extends BaseModel
*/
public function getRepository()
{
if (! $this->repository || ! class_exists($this->repository) || ! interface_exists($this->repository)) {
if (! $this->repository || ! class_exists($this->repository) && ! interface_exists($this->repository)) {
throw new RuntimeException(sprintf('Cannot detect the repository of %s', static::class));
}
return $this->getContainer()->get($this->repository);