修改代码生成

This commit is contained in:
liaofei 2023-05-22 11:52:15 +08:00
parent 81a73688b5
commit f8929fe968
2 changed files with 18 additions and 2 deletions

View File

@ -619,14 +619,18 @@ class SystemCrud extends AuthController
continue;
}
if (isset($item['is_table']) && $item['is_table']) {
$label = '';
if (in_array($item['from_type'], ['frameImageOne', 'frameImages'])) {
$keyName = 'slot';
} elseif (in_array($item['from_type'], ['radio', 'select', 'checkbox'])) {
$label = app()->make(Make::class)->getAttrPrefix();
} else {
$keyName = 'key';
}
$columns[] = [
'title' => $item['table_name'] ?: $item['comment'],
$keyName => $item['field'],
$keyName => $item['field'] . $label,
'from_type' => $item['from_type'],
];
}

View File

@ -142,6 +142,18 @@ abstract class Make
return $this;
}
/**
* 获取字段后缀
* @return string
* @author 等风来
* @email 136327134@qq.com
* @date 2023/5/22
*/
public function getAttrPrefix()
{
return $this->attrPrefix;
}
/**
* @return string
* @author 等风来
@ -204,7 +216,7 @@ abstract class Make
public function setFilePathName(string $filePathName = '')
{
if ($filePathName) {
$this->filePathName = $filePathName;
// $this->filePathName = $filePathName;
}
return $this;
}