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

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

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