\App\ModelsSysUserDept

用户任职归属(组织轴核心)

职责:记录用户「任职于哪个部门、担任何种岗位」的归属关系。 一人可多部门、可跨组织;任职仅为归属标记(V6.2 起不再携带数据范围—— 范围载体已迁至 td_sys_post_scope / td_sys_user_scope),负责人标记 is_leader 保留。

Summary

Methods
Properties
Constants
timestampCasts()
user()
dept()
post()
$timestamps
$id
$user_id
$dept_id
$post_id
$scope
$is_leader
$create_time
SCOPE_DEPT
SCOPE_COMPANY
serializeDate()
casts()
$table
$fillable
N/A
No private methods found
No private properties found
N/A

Constants

SCOPE_DEPT

SCOPE_DEPT = 2

本部门(含下级)

SCOPE_COMPANY

SCOPE_COMPANY = 3

本公司

Properties

$timestamps

$timestamps

$id

$id : int

主键ID

Type

int

$user_id

$user_id : int

用户ID

Type

int

$dept_id

$dept_id : int

部门ID

Type

int

$post_id

$post_id : int

任职岗位ID

Type

int

$scope

$scope : int|null

【历史列·备查】V6.2 起业务停用,代码不再读写;存量数据保留

Type

int|null

$is_leader

$is_leader : int

是否部门负责人:1 是(全见本部门含下级)

Type

int

$create_time

$create_time : string

创建时间

┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 常量 scope 历史范围值 分区 2 · 表名与属性 $table / $fillable / casts 分区 3 · 关联关系 user / dept / post └────────────────────────────────────────────────────────────┘

Type

string

$table

$table

$fillable

$fillable

Methods

timestampCasts()

timestampCasts() : array<string,string>

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

Returns

array

user()

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

任职的用户

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo —

dept()

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

任职的部门

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo —

post()

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