Explorar o código

修正 Show.php 实例化函数如果传递模型,主键赋值错误的问题。

jisuye %!s(int64=4) %!d(string=hai) anos
pai
achega
b03850c6e7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Show.php

+ 1 - 1
src/Show.php

@@ -131,7 +131,7 @@ class Show implements Renderable
             $this->repository = Admin::repository($model);
         } elseif ($model instanceof Model) {
             if ($key = $model->getKey()) {
-                $this->key = $model->getKey();
+                $this->_id = $model->getKey();
                 $this->keyName = $model->getKeyName();
 
                 $this->model($model);