\App\ModelsSysDictData

字典数据项

职责:字典的具体取值项,支持平铺字典(parent_id=0)和树形字典(parent_id 关联自身)。

Summary

Methods
Properties
Constants
parent()
children()
timestampCasts()
type()
$timestamps
$id
$type_id
$type_code
$parent_id
$label
$value
$sort
$css_class
$i18n_key
$status
$remark
$create_time
$update_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

$type_id

$type_id : int

字典类型ID

Type

int

$type_code

$type_code : string

字典类型编码

Type

string

$parent_id

$parent_id : int

父级ID,0 表示顶级

Type

int

$label

$label : string

显示值

Type

string

$value

$value : string

存储值

Type

string

$sort

$sort : int

排序号

Type

int

$css_class

$css_class : string

样式类名

Type

string

$i18n_key

$i18n_key : string

国际化 key

Type

string

$status

$status : int

状态:1 启用,0 停用

Type

int

$remark

$remark : string

备注说明

Type

string

$create_time

$create_time : string

创建时间

Type

string

$update_time

$update_time : string|null

更新时间

┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 常量 本地枚举(启停状态 STATUS_* 已单源 HasStatusConstants) 分区 2 · 表名与属性 $table / $fillable / casts 分区 3 · 关联关系 type / parent / children └────────────────────────────────────────────────────────────┘

Type

string|null

$table

$table

$fillable

$fillable

Methods

parent()

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

父级数据项(平铺字典恒为 0,无记录,自然返回 null)

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo —

children()

children() : \Illuminate\Database\Eloquent\Relations\HasMany

子级数据项(树形字典)

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

timestampCasts()

timestampCasts() : array<string,string>

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

Returns

array

type()

type() : \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 —