\App\ModelsSysPost

系统岗位

职责:数据权限体系(组织单轴)的岗位实体。岗位唯一归属一个部门(td_sys_post.dept_id, 取消跨部门共享——同一岗位定义/数据范围不再被多部门复用), 配置数据范围(td_sys_post_scope:显式组织 / 末级部门)。 岗位只管数据、不管功能——菜单/权限归属角色(td_sys_role_menu / td_sys_role_permission)。 用户经 td_sys_user_dept 任职岗位;最终可见集 = 任职岗位范围 ∪ 个人范围。

Summary

Methods
Properties
Constants
timestampCasts()
scopeRules()
dept()
users()
$timestamps
$id
$name
$code
$dept_id
$sort
$status
$remark
$create_time
$update_time
CODE_SUPER
serializeDate()
casts()
$table
$fillable
N/A
No private methods found
No private properties found
N/A

Constants

CODE_SUPER

CODE_SUPER = 'super'

内置超级管理员岗位编码:任职者数据全见(替代原 is_exempt 豁免开关),不可删除

Properties

$timestamps

$timestamps

$id

$id : int

主键ID

Type

int

$name

$name : string

岗位名称

Type

string

$code

$code : string

岗位编码

Type

string

$dept_id

$dept_id : int

所属部门ID:岗位唯一归属一个部门;内置超级管理员岗位恒 0,全局不挂部门

Type

int

$sort

$sort : int

排序号

Type

int

$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 · 关联关系 scopeRules / dept / users └────────────────────────────────────────────────────────────┘

Type

string|null

$table

$table

$fillable

$fillable

Methods

timestampCasts()

timestampCasts() : array<string,string>

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

Returns

array

scopeRules()

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

岗位数据范围配置(经 td_sys_post_scope)。

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

dept()

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

岗位所属部门(一对一,岗位唯一归属一个部门)。

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo —

users()

users() : \Illuminate\Database\Eloquent\Relations\BelongsToMany

任职该岗位的用户(多对多,经 td_sys_user_dept)。

Returns

\Illuminate\Database\Eloquent\Relations\BelongsToMany —

serializeDate()

serializeDate(\DateTimeInterface  $date) : string

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

Parameters

\DateTimeInterface $date

Returns

string —

casts()

casts() : array

Returns

array —