Commit b2cd81d1 authored by jiangkebao's avatar jiangkebao

默认值问题修改

parent a48fbab0
......@@ -721,7 +721,7 @@ class MakeModelCommand extends HyperfCommand
$rs = [];
$required = "nullable";
if ($null !== 'YES') {
if (!$default) {
if ($default !== '') {
$required = "required";
$messages[] = "\t\t'{$name}.{$required}' => '{$msgName}不能为空!'";
}
......@@ -1136,7 +1136,7 @@ class MakeModelCommand extends HyperfCommand
if ($null == 'YES') {
$t .= "->nullable()";
}
if ($default || $default === '0') {
if ($default !== '') {
$t .= "->default('$default')";
}
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