\App\ModelsSysMessage

系统通知(公告与系统事件统一模型)

职责:公告(管理员发布)与系统事件(密码重置/登录提醒/配额/worker 告警) 的统一载体;target 五维定向 + need_read 开关 + biz_key 防重。

Summary

Methods
Properties
Constants
timestampCasts()
reads()
$timestamps
$id
$msg_type
$title
$content
$target_type
$target_ids
$need_read
$sender_id
$status
$target_count
$publish_time
$expire_time
$biz_key
$create_time
$update_time
TYPE_ANNOUNCEMENT
TYPE_SECURITY
TYPE_ACCOUNT
TYPE_QUOTA
TYPE_WORKER
TARGET_ALL
TARGET_DEPT
TARGET_POST
TARGET_ROLE
TARGET_USER
STATUS_DRAFT
STATUS_PUBLISHED
STATUS_REVOKED
NEED_READ_YES
NEED_READ_NO
serializeDate()
casts()
$table
$fillable
N/A
No private methods found
No private properties found
N/A

Constants

TYPE_ANNOUNCEMENT

TYPE_ANNOUNCEMENT = 'announcement'

类型:公告

TYPE_SECURITY

TYPE_SECURITY = 'security'

类型:登录安全

TYPE_ACCOUNT

TYPE_ACCOUNT = 'account'

类型:账户

TYPE_QUOTA

TYPE_QUOTA = 'quota'

类型:配额

TYPE_WORKER

TYPE_WORKER = 'worker'

类型:系统告警

TARGET_ALL

TARGET_ALL = 'all'

定向:全员

TARGET_DEPT

TARGET_DEPT = 'dept'

定向:部门(含子孙快照)

TARGET_POST

TARGET_POST = 'post'

定向:岗位

TARGET_ROLE

TARGET_ROLE = 'role'

定向:角色

TARGET_USER

TARGET_USER = 'user'

定向:指定用户

STATUS_DRAFT

STATUS_DRAFT = 0

状态:草稿

STATUS_PUBLISHED

STATUS_PUBLISHED = 1

状态:已发布

STATUS_REVOKED

STATUS_REVOKED = 2

状态:已撤回

NEED_READ_YES

NEED_READ_YES = 1

已读跟踪:跟踪

NEED_READ_NO

NEED_READ_NO = 0

已读跟踪:仅展示

Properties

$timestamps

$timestamps

$id

$id : int

通知 id

Type

int

$msg_type

$msg_type : string

类型(announcement/security/account/quota/worker)

Type

string

$title

$title : string

标题

Type

string

$content

$content : string

正文(纯文本)

Type

string

$target_type

$target_type : string

定向(all/dept/post/role/user)

Type

string

$target_ids

$target_ids : array

目标 id 数组

Type

array

$need_read

$need_read : int

已读跟踪开关(1=跟踪/0=仅展示)

Type

int

$sender_id

$sender_id : int

发布人 id(系统事件=0)

Type

int

$status

$status : int

状态(0 草稿/1 已发布/2 已撤回)

Type

int

$target_count

$target_count : int

发布时目标人数快照

Type

int

$publish_time

$publish_time : string|null

发布时间

Type

string|null

$expire_time

$expire_time : string|null

有效期

Type

string|null

$biz_key

$biz_key : string|null

业务幂等键

Type

string|null

$create_time

$create_time : string

创建时间

Type

string

$update_time

$update_time : string

更新时间

┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 常量 类型/定向/状态/开关标记 分区 2 · 表名与属性 $table / $fillable / casts └────────────────────────────────────────────────────────────┘

Type

string

$table

$table

$fillable

$fillable

Methods

timestampCasts()

timestampCasts() : array<string,string>

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

Returns

array

reads()

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

已读记录(稀疏表:用户读了哪条插哪行;统计与未读差集共用)

Returns

\Illuminate\Database\Eloquent\Relations\HasMany —

serializeDate()

serializeDate(\DateTimeInterface  $date) : string

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

Parameters

\DateTimeInterface $date

Returns

string —

casts()

casts() : array

Returns

array —