Commit b2cd81d1 authored by jiangkebao's avatar jiangkebao

默认值问题修改

parent a48fbab0
...@@ -721,7 +721,7 @@ class MakeModelCommand extends HyperfCommand ...@@ -721,7 +721,7 @@ class MakeModelCommand extends HyperfCommand
$rs = []; $rs = [];
$required = "nullable"; $required = "nullable";
if ($null !== 'YES') { if ($null !== 'YES') {
if (!$default) { if ($default !== '') {
$required = "required"; $required = "required";
$messages[] = "\t\t'{$name}.{$required}' => '{$msgName}不能为空!'"; $messages[] = "\t\t'{$name}.{$required}' => '{$msgName}不能为空!'";
} }
...@@ -1136,7 +1136,7 @@ class MakeModelCommand extends HyperfCommand ...@@ -1136,7 +1136,7 @@ class MakeModelCommand extends HyperfCommand
if ($null == 'YES') { if ($null == 'YES') {
$t .= "->nullable()"; $t .= "->nullable()";
} }
if ($default || $default === '0') { if ($default !== '') {
$t .= "->default('$default')"; $t .= "->default('$default')";
} }
if ($collation) { if ($collation) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment