rkljw 1 天之前
父节点
当前提交
c7799916a6
共有 1 个文件被更改,包括 14 次插入2 次删除
  1. 14 2
      app/JsonRpc/FormService.php

+ 14 - 2
app/JsonRpc/FormService.php

@@ -180,8 +180,20 @@ class FormService implements FormServiceInterface
      */
     public function getGlobalTableFieldList(array $data): array
     {
-        $globalTableField = GlobalTableField::where('table_id',$data['id'])->orderBy("sort","asc")->get();
-        return Result::success($globalTableField);
+        $fields = GlobalTableField::from('global_table_field as a')
+            ->join('global_table_field_type as b', 'a.field_type', '=', 'b.id')
+            ->where('a.table_id', $data['id'])
+            ->orderBy('a.sort', 'asc')
+            ->select(
+            // global_table_field 所有字段
+                'a.*',
+                // global_table_field_type 字段
+                'b.type_name',
+                'b.type_name_alias',
+                'b.field_type as type_definition'
+            )
+            ->get();
+        return Result::success($fields);
     }
     /**
      * 获取表单字段