*/ public const STATUS_TEXT_MAP = [ self::STATUS_PENDING => '待执行', self::STATUS_SENT => '已发送', self::STATUS_CANCELLED => '已取消', self::STATUS_FAILED => '发送失败', ]; /** * @notes 状态文本访问器 */ public function getStatusTextAttr($value, $data): string { $status = (int) ($data['status'] ?? 0); return self::STATUS_TEXT_MAP[$status] ?? '未知'; } /** * @notes 提醒时间格式化(Y-m-d H:i) */ public function getRemindTimeTextAttr($value, $data): string { $ts = (int) ($data['remind_time'] ?? 0); return $ts > 0 ? date('Y-m-d H:i', $ts) : ''; } /** * @notes 推送时间格式化 */ public function getNotifiedAtTextAttr($value, $data): string { $ts = (int) ($data['notified_at'] ?? 0); return $ts > 0 ? date('Y-m-d H:i', $ts) : ''; } /** * @notes 取消时间格式化 */ public function getCancelledAtTextAttr($value, $data): string { $ts = (int) ($data['cancelled_at'] ?? 0); return $ts > 0 ? date('Y-m-d H:i', $ts) : ''; } }