\App\ModelsSysTemplateVersion

模板版本历史

职责:每次「发布」写入一条快照(线上内容 + 版本号 + 发布人/备注),管理页可看历史、 逐版预览、回滚(回滚 = 快照内容发布为新版本,历史永不失联)。 主表 version 为当前线上版本号,与 (template_id, version) 对应。

Summary

Methods
Properties
Constants
timestampCasts()
template()
creator()
$timestamps
$id
$template_id
$version
$subject
$content
$vars
$meta
$remark
$created_by
$create_time
No constants found
serializeDate()
casts()
$table
$fillable
N/A
No private methods found
No private properties found
N/A

Properties

$timestamps

$timestamps

$id

$id : int

主键ID

Type

int

$template_id

$template_id : int

模板 ID(td_sys_template.id)

Type

int

$version

$version : int

版本号(与主表 version 对应)

Type

int

$subject

$subject : string|null

该版本主题快照(邮件/单页类)

Type

string|null

$content

$content : string

该版本正文快照

Type

string

$vars

$vars : array

该版本变量声明快照

Type

array

$meta

$meta : array

该版本类型扩展快照

Type

array

$remark

$remark : string

发布备注

Type

string

$created_by

$created_by : int|null

发布人(td_sys_user.id)

Type

int|null

$create_time

$create_time : string

创建时间

┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 表名与属性 $timestamps / $table / $fillable / casts 分区 2 · 关联关系 template / creator └────────────────────────────────────────────────────────────┘

Type

string

$table

$table

$fillable

$fillable

Methods

timestampCasts()

timestampCasts() : array<string,string>

全库统一的时间列 cast 段(单源:约 22 个模型 casts() 内重复的两行)。 使用方模型 casts() 内 `return array_merge(self::timestampCasts(), [...])`。

Returns

array

template()

template() : \Illuminate\Database\Eloquent\Relations\BelongsTo

所属模板

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo —

creator()

creator() : \Illuminate\Database\Eloquent\Relations\BelongsTo

发布人

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo —

serializeDate()

serializeDate(\DateTimeInterface  $date) : string

所有日期属性统一按 "年-月-日 时:分:秒" 序列化。

Parameters

\DateTimeInterface $date

Returns

string —

casts()

casts() : array

Returns

array —