{assign var="datetime" value=$file->GetFileCreateTime()} {assign var="namespace" value=$file->GetNamespace()} {assign var="classes" value=$file->GetClasses()} {assign var="uses" value=$file->GetUses()} GetClassName()} {assign var="tableName" value=$classes[index]->GetTable()->GetName()} {assign var="attrs" value=$classes[index]->GetAttrs()} {assign var="extends" value=$classes[index]->GetExtends()} class {$className}{foreach item=e from=$extends key=i}{if $i == 0} extends {/if}{$e}{/foreach}{ public static function tableName() { return '{literal}{{{/literal}{{$tableName}}{literal}}}{/literal}'; } {section name=index loop=$attrs} {assign var="fieldName" value=$attrs[index]->GetColumn()->GetName()} {assign var="fieldComment" value=$attrs[index]->GetColumn()->GetComment()} {assign var="attrName" value=$attrs[index]->GetName()} /** * ------------ 字段 {{$fieldName}} * ------------ 表字段注释: {{$fieldComment}} */ public function set{{$attrName}}($val): self { $this->setAttr("{{$fieldName}}", $val); return $this; } // --------------------------------------------- {/section} } {/section}