更新代码生成

This commit is contained in:
2025-09-01 13:08:26 +08:00
parent b2c9aecfb9
commit 1bb8cbcecd

16
app/Service/core/CodeGenerationService.php Normal file → Executable file
View File

@@ -15,7 +15,9 @@ class CodeGenerationService
{ {
const TEXT_TYPE = [ const TEXT_TYPE = [
'LONGTEXT', 'LONGTEXT',
'TEXT' 'TEXT',
'longtext',
'text',
]; ];
const INT_TYPE = [ const INT_TYPE = [
'INT', 'INT',
@@ -23,6 +25,13 @@ class CodeGenerationService
'BIGINT', 'BIGINT',
'SMALLINT', 'SMALLINT',
'FLOAT', 'FLOAT',
'DECIMAL',
'int',
'tinyint',
'bigint',
'smallint',
'float',
'decimal',
]; ];
private static mixed $_instance; private static mixed $_instance;
@@ -140,6 +149,8 @@ class CodeGenerationService
'created_at' => time(), 'created_at' => time(),
'updated_at' => time(), 'updated_at' => time(),
]); ]);
// 删除Store/app/www
Storage::deleteDirectory('www');
return [ return [
'id' => $insertModel->id, 'id' => $insertModel->id,
'file_name' => $insertModel->file_name 'file_name' => $insertModel->file_name
@@ -444,6 +455,9 @@ class CodeGenerationService
{ {
if (empty($item)) return; if (empty($item)) return;
// 设置列表字段 // 设置列表字段
if (!isset($item['tableShow'])) {
ds($item);
}
if ($item['tableShow']) { if ($item['tableShow']) {
$this->selectField .= ', "' . $item['name'] . '"'; $this->selectField .= ', "' . $item['name'] . '"';
} }