主键不自增时主键显示在表单

This commit is contained in:
walkor 2023-05-16 10:23:06 +08:00
parent 3d39d38287
commit 5d3ce0ff12
2 changed files with 3 additions and 2 deletions

View File

@ -799,6 +799,7 @@ EOF;
$field = $info['field']; $field = $info['field'];
$default = $columns[$key]['default']; $default = $columns[$key]['default'];
$control = strtolower($info['control']); $control = strtolower($info['control']);
$auto_increment = $columns[$key]['auto_increment'];
// 搜索框里上传组件替换为input // 搜索框里上传组件替换为input
if ($type == 'search' && in_array($control, ['upload', 'uploadimg'])) { if ($type == 'search' && in_array($control, ['upload', 'uploadimg'])) {
$control = 'input'; $control = 'input';
@ -815,7 +816,7 @@ EOF;
$props['value'] = $default; $props['value'] = $default;
} }
// 表单不显示主键 // 表单不显示主键
if ($filter == 'form_show' && $primary_key && $field == $primary_key) { if (($filter == 'form_show' && $primary_key && $field == $primary_key && $auto_increment)) {
continue; continue;
} }
// 范围查询 // 范围查询

View File

@ -17,5 +17,5 @@ return [
'controller_suffix' => 'Controller', 'controller_suffix' => 'Controller',
'controller_reuse' => false, 'controller_reuse' => false,
'plugin_market_host' => 'https://www.workerman.net', 'plugin_market_host' => 'https://www.workerman.net',
'version' => '0.6.0' 'version' => '0.6.12'
]; ];