\App\ModelsSysPostScope

岗位数据范围(组织权限改造)

职责:岗位的显式数据范围配置。用户可见部门集 = 其任职岗位的范围并集 ∪ 个人范围 ∪ 负责人部门(is_leader)。

Summary

Methods
Properties
Constants
timestampCasts()
post()
company()
dept()
$timestamps
$id
$post_id
$scope_mode
$company_id
$dept_id
$create_time
MODE_ORG
MODE_DEPT
serializeDate()
casts()
$table
$fillable
N/A
No private methods found
No private properties found
N/A

Constants

MODE_ORG

MODE_ORG = 0

显式组织(company_id,dept_id=0 → 该组织全部启用部门)

MODE_DEPT

MODE_DEPT = 1

显式末级部门(company_id + dept_id → 仅该部门,dept 必须为叶子节点)

Properties

$timestamps

$timestamps

$id

$id : int

主键ID

Type

int

$post_id

$post_id : int

岗位ID

Type

int

$scope_mode

$scope_mode : int

范围模式:0 显式组织、1 显式末级部门

Type

int

$company_id

$company_id : int

显式组织ID,末级部门模式的所属组织

Type

int

$dept_id

$dept_id : int

显式末级部门模式部门ID(仅末级可勾),其余为0

Type

int

$create_time

$create_time : string

创建时间

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

Type

string

$table

$table

$fillable

$fillable

Methods

timestampCasts()

timestampCasts() : array<string,string>

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

Returns

array

post()

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

所属岗位

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo —

company()

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

范围组织

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo —

dept()

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

范围末级部门(scope_mode=0 时为 0,无记录,自然返回 null)

Returns

\Illuminate\Database\Eloquent\Relations\BelongsTo —

serializeDate()

serializeDate(\DateTimeInterface  $date) : string

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

Parameters

\DateTimeInterface $date

Returns

string —

casts()

casts() : array

Returns

array —