Files
chatroom/database/migrations/2026_02_28_201430_create_positions_table.php
lkddi 5f30220609 feat: 任命/撤销通知系统 + 用户名片UI优化
- 任命/撤销事件增加 type 字段区分类型
- 任命:全屏礼花 + 紫色弹窗 + 紫色系统消息
- 撤销:灰色弹窗 + 灰色系统消息,无礼花
- 消息分发:操作者/被操作者显示在私聊面板,其他人显示在公屏
- 系统消息加随机鼓励语(各5条轮换)
- ChatStateService 修复 Redis key 前缀扫描问题(getAllActiveRoomIds)
- 用户名片折叠优化:管理员视野、职务履历均可折叠
- 管理操作 + 职务操作合并为「🔧 管理操作」折叠区
- 悄悄话改为「🎁 送礼物」按钮,礼物面板内联展开
2026-02-28 23:44:38 +08:00

45 lines
1.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* 文件功能:创建职务表迁移
* 职务属于某个部门,包含 rank 位阶、对应 user_level、人数上限、奖励上限和展示图标
*
* @author ChatRoom Laravel
*
* @version 1.0.0
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* 创建职务表
*/
public function up(): void
{
Schema::create('positions', function (Blueprint $table) {
$table->id();
$table->foreignId('department_id')->constrained('departments')->cascadeOnDelete()->comment('所属部门');
$table->string('name', 50)->comment('职务名称');
$table->string('icon', 10)->nullable()->comment('职务图标emoji展示在聊天室用户列表');
$table->unsignedTinyInteger('rank')->default(0)->comment('职务位阶0~99跨全局排序99 最高)');
$table->tinyInteger('level')->default(1)->comment('对应 user_level任命后同步写入 users.user_level');
$table->unsignedTinyInteger('max_persons')->nullable()->comment('人数上限null=不限)');
$table->unsignedInteger('max_reward')->nullable()->comment('单次奖励上限金币null=不限)');
$table->tinyInteger('sort_order')->default(0)->comment('后台列表排序');
$table->timestamps();
});
}
/**
* 回滚:删除职务表
*/
public function down(): void
{
Schema::dropIfExists('positions');
}
};