\App\ModelsSysUser

系统用户

职责:后台管理员用户实体——认证主体(JWTSubject)+ 数据权限主体的关联枢纽。 密码加盐哈希存储、凭据字段序列化隐藏、状态/超管标记等安全语义在此固化。

Summary

Methods
Properties
Constants
timestampCasts()
roles()
posts()
memberships()
scopeRules()
permissionGrants()
ledDepts()
legalCompanies()
files()
fileFolders()
templateVersions()
getJWTIdentifier()
getJWTCustomClaims()
$timestamps
$id
$username
$password
$employee_no
$real_name
$phone
$email
$avatar
$status
$quota_mb
$is_super
$salt
$last_login_ip
$last_login_time
$token_key
$token_expires_at
$is_remember
$create_time
$update_time
No constants found
serializeDate()
casts()
$table
$fillable
$hidden
N/A
No private methods found
No private properties found
N/A

Properties

$timestamps

$timestamps

$id

$id : int

主键ID

Type

int

$username

$username : string

用户名

Type

string

$password

$password : string

密码,bcrypt 加密存储

Type

string

$employee_no

$employee_no : string|null

工号

Type

string|null

$real_name

$real_name : string

真实姓名

Type

string

$phone

$phone : string

手机号

Type

string

$email

$email : string

邮箱

Type

string

$avatar

$avatar : string

头像——文件库文件 id,经 files/{id}/download 鉴权取图,历史公开盘 URL 兼容只读

Type

string

$status

$status : int

状态:1 启用,0 停用

Type

int

$quota_mb

$quota_mb : int|null

空间配额(MB):null/0=跟随全局默认,-1=不限,正整数=个人独立配额

Type

int|null

$is_super

$is_super : int

是否超级管理员:1 是,0 否

Type

int

$salt

$salt : string

加密盐

Type

string

$last_login_ip

$last_login_ip : string

最后登录 IP

Type

string

$last_login_time

$last_login_time : string|null

最后登录时间

Type

string|null

$token_key

$token_key : string

当前登录 MD5 钥匙

Type

string

$token_expires_at

$token_expires_at : string|null

Token 过期时间

Type

string|null

$is_remember

$is_remember : int

是否记住登录:1 是,0 否

Type

int

$create_time

$create_time : string

创建时间

Type

string

$update_time

$update_time : string|null

更新时间

┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 常量 本地枚举(启停状态 STATUS_* 已单源 HasStatusConstants) 分区 2 · 表名与属性 $table / $fillable / $hidden / casts 分区 3 · 关联关系 角色、任职、范围、权限、组织与文件关联 分区 4 · JWTSubject 接口 getJWTIdentifier / getJWTCustomClaims └────────────────────────────────────────────────────────────┘

Type

string|null

$table

$table

$fillable

$fillable

$hidden

$hidden

Methods

timestampCasts()

timestampCasts() : array<string,string>

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

Returns

array

roles()

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

用户拥有的角色(多对多,直授,经 td_sys_user_role 表)。

Returns

\Illuminate\Database\Eloquent\Relations\BelongsToMany —

posts()

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

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

Returns

\Illuminate\Database\Eloquent\Relations\BelongsToMany —

memberships()

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

用户任职记录(一人多部门多岗位,经 td_sys_user_dept)。

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

scopeRules()

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

个人数据范围配置(最终可见集 = 任职岗位范围 ∪ 个人范围中的个人部分)。

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

permissionGrants()

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

个人权限配置(仅按钮/接口权限,与角色权限并集生效)。

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

ledDepts()

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

负责的部门(部门负责人,is_leader 全见本部门含下级的数据范围来源)。

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

legalCompanies()

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

任法人的组织(组织档案引用)。

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

files()

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

上传的文件(文件库归属人)。

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

fileFolders()

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

个人空间目录(文件维护逻辑目录树)。

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

templateVersions()

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

发布的模板版本(模板版本工作流发布人)。

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

getJWTIdentifier()

getJWTIdentifier() : mixed

Returns

mixed —

getJWTCustomClaims()

getJWTCustomClaims() : array

Returns

array —

serializeDate()

serializeDate(\DateTimeInterface  $date) : string

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

Parameters

\DateTimeInterface $date

Returns

string —

casts()

casts() : array

Returns

array —