优化代码
This commit is contained in:
@@ -114,8 +114,8 @@ class Datatable {
|
||||
} else {
|
||||
$field_attr['length'] = "";
|
||||
}
|
||||
$field_attr['is_null'] = $attr['is_must'] ? 'NOT NULL' : 'NULL';
|
||||
$field_attr['default'] = $attr['value'] != '' ? 'DEFAULT "' . $attr['value'] . '"' : '';
|
||||
$field_attr['is_null'] = (isset($attr['is_must']) && $attr['is_must']) ? 'NOT NULL' : 'NULL';
|
||||
$field_attr['default'] = (isset($attr['is_must']) && $attr['is_must'] !== '') ? 'DEFAULT "' . $attr['value'] . '"' : '';
|
||||
|
||||
$field_attr['comment'] = (isset($attr['remark']) && $attr['remark']) ? $attr['remark'] : $attr['title'];
|
||||
$field_attr['after'] = (isset($attr['after']) && $attr['after']) ? ' AFTER `' . $attr['after'] . '`' : ' AFTER `id`';
|
||||
|
||||
Reference in New Issue
Block a user