From 16cba0daeb5cc1c48f562d19a1b2fad31c4ca886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com> Date: Mon, 18 Jul 2022 16:16:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(CRUD):=E4=BF=AE=E5=A4=8D=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=BAchar(1)=E6=97=B6=EF=BC=8C=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=9A=84=E5=8D=95=E9=80=89=E6=A1=86=E6=97=A0=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/command/Crud.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/admin/command/Crud.php b/app/admin/command/Crud.php index a02a52a1..7fa35493 100644 --- a/app/admin/command/Crud.php +++ b/app/admin/command/Crud.php @@ -1525,19 +1525,15 @@ class Crud extends Command /** * 列替换数据 */ - public function getColumnReplaceData(&$column, $fieldName, $inputType) + public function getColumnReplaceData($column, $fieldName, $inputType) { $columnData = []; - if (in_array($column['DATA_TYPE'], ['enum', 'set', 'tinyint'])) { + if (in_array($column['DATA_TYPE'], ['enum', 'set', 'tinyint', 'char'])) { if ($column['DATA_TYPE'] !== 'tinyint') { $columnData = substr($column['COLUMN_TYPE'], strlen($column['DATA_TYPE']) + 1, -1); $columnData = explode(',', str_replace("'", '', $columnData)); } $columnData = $this->getItemArray($columnData, $fieldName, $column['COLUMN_COMMENT']); - // 如果类型为tinyint且有使用备注数据 - if ($columnData && $column['DATA_TYPE'] == 'tinyint') { - $column['DATA_TYPE'] = 'enum'; - } } if (!$columnData && in_array($inputType, ['select', 'selects'])) { $columnData = $this->getItemArray($columnData, $fieldName, $column['COLUMN_COMMENT']);