浏览代码

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

jisuye 4 年之前
父节点
当前提交
b03850c6e7
共有 1 个文件被更改,包括 1 次插入1 次删除
  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);