|
@@ -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);
|
|
|
}
|
|
|
/**
|
|
|
* 获取表单字段
|