浏览代码

修复模型树RowAction异步处理接口时获取主键报错问题

jqh 4 年之前
父节点
当前提交
97de68519d
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Tree/RowAction.php

+ 4 - 0
src/Tree/RowAction.php

@@ -26,6 +26,10 @@ class RowAction extends Action
      */
     public function getKey()
     {
+        if ($key = parent::getKey()) {
+            return $key;
+        }
+
         return $this->row->{$this->actions->parent()->getKeyName()};
     }