Skip to content

Commit

Permalink
表格数据读取支持额外数据字段
Browse files Browse the repository at this point in the history
  • Loading branch information
gongfuxiang committed Dec 29, 2024
1 parent 515ef58 commit 8fdff54
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -1963,6 +1963,7 @@ function FormModuleData($params = [])

// 默认
default :
// 指定数据
if(array_key_exists($data_type, $ret['data']))
{
$data = $ret['data'][$data_type];
Expand All @@ -1976,6 +1977,22 @@ function FormModuleData($params = [])
];
}
}

// 额外数据字段
if(!empty($struct['params']['ext_data_fields']))
{
if(!is_array($struct['params']['ext_data_fields']))
{
$struct['params']['ext_data_fields'] = explode(',', $struct['params']['ext_data_fields']);
}
foreach($struct['params']['ext_data_fields'] as $edfv)
{
if(array_key_exists($edfv, $ret['data']))
{
$data[$edfv] = $ret['data'][$edfv];
}
}
}
}
}
return $data;
Expand Down

0 comments on commit 8fdff54

Please sign in to comment.