浏览代码

!439 CRUD生成字段默认值bug
Merge pull request !439 from Jon/develop

Karson 2 年之前
父节点
当前提交
0a062a8d63
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      application/admin/command/Crud.php

+ 5 - 0
application/admin/command/Crud.php

@@ -957,6 +957,11 @@ class Crud extends Command
                             $attrArr['size'] = 50;
                         }
 
+                        //字段默认值判断
+                        if ('NULL' == $defaultValue || "''" == $defaultValue) {
+                            $defaultValue = '';
+                        }
+
                         $formAddElement = Form::input($inputType, $fieldName, $defaultValue, $attrArr);
                         $formEditElement = Form::input($inputType, $fieldName, $editValue, $attrArr);
                         if ($search && $replace) {