Commit 47512cd0 authored by 王源's avatar 王源 🎧

修复模型生成中$timestamps的bug,修改注释

parent b1c6d698
...@@ -337,8 +337,8 @@ class MakeModelCommand extends HyperfCommand ...@@ -337,8 +337,8 @@ class MakeModelCommand extends HyperfCommand
'array' => 'array', 'array' => 'array',
'json' => 'string', 'json' => 'string',
]; ];
$properties .= " * @property " . (isset($pc[$v['data_type']]) ? $pc[$v['data_type']] : "string") . " $" . $name . "\n"; $properties .= " * @property " . (isset($pc[$v['data_type']]) ? $pc[$v['data_type']] : "string") . " $" . $name . ($v['column_comment'] ? " " . $v['column_comment'] : "") . "\n";
if ($name == 'created_at' || $name == 'created_at') { if ($name == 'created_at' || $name == 'updated_at') {
$timestamps++; $timestamps++;
} }
if ($name == 'deleted_at') { if ($name == 'deleted_at') {
...@@ -347,7 +347,7 @@ class MakeModelCommand extends HyperfCommand ...@@ -347,7 +347,7 @@ class MakeModelCommand extends HyperfCommand
if (in_array($name, $filterFields)) { if (in_array($name, $filterFields)) {
continue; continue;
} }
$fillAble .= "\t\t'" . $name . "'," . ($v['column_comment'] ? "// " . $v['column_comment'] : "") . "\n"; $fillAble .= "\t\t'" . $name . "'," . "\n";
if (isset($this->cc[$v['data_type']]) && $this->cc[$v['data_type']] != 'string') { if (isset($this->cc[$v['data_type']]) && $this->cc[$v['data_type']] != 'string') {
$casts .= "\t\t'" . $name . "'=>'" . $this->cc[$v['data_type']] . "',\n"; $casts .= "\t\t'" . $name . "'=>'" . $this->cc[$v['data_type']] . "',\n";
} }
......
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