Browse Source

关联数据表的字段修改

朱金辉 3 weeks ago
parent
commit
8c8d5896e8
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/Driver/Entity/Base.php

+ 7 - 0
src/Driver/Entity/Base.php

@@ -1225,6 +1225,9 @@ class Base {
             $fields = $args[2];
             if(!in_array($relKey, $fields)) $fields[] = $relKey;
         }
+        if(count($fields) == 0) {
+            $fields = $this->getFields();
+        }
         if(count($this->getFields()) > 0 && !in_array($relKey, $this->getFields())) {
             $fields[] = $relKey;
         }
@@ -1254,9 +1257,13 @@ class Base {
             $fields = $args[2];
             if(!in_array($relKey, $fields)) $fields[] = $relKey;
         }
+        if(count($fields) == 0) {
+            $fields = $this->getFields();
+        }
         if(count($this->getFields()) > 0 && !in_array($relKey, $this->getFields())) {
             $fields[] = $relKey;
         }
+
         if(array_search('*', $fields) !== false) {
             $fields = ['*'];
         }