完善职务礼包红包默认配置

This commit is contained in:
2026-04-24 23:09:32 +08:00
parent 4486a87326
commit 5273b4ee4b
12 changed files with 394 additions and 93 deletions
@@ -0,0 +1,44 @@
<?php
/**
* 文件功能:为职务表增加礼包红包默认配置。
*
* 每个职务可独立设置礼包红包总量和份数,发金币礼包与经验礼包时共用这组配置。
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* 类功能:维护 positions 表的礼包红包默认总量与份数字段。
*/
return new class extends Migration
{
/**
* 方法功能:新增职务礼包红包总量和份数字段。
*/
public function up(): void
{
Schema::table('positions', function (Blueprint $table) {
$table->unsignedInteger('red_packet_amount')
->default(8888)
->after('permissions')
->comment('礼包红包默认总量');
$table->unsignedSmallInteger('red_packet_count')
->default(10)
->after('red_packet_amount')
->comment('礼包红包默认份数');
});
}
/**
* 方法功能:删除职务礼包红包配置字段。
*/
public function down(): void
{
Schema::table('positions', function (Blueprint $table) {
$table->dropColumn(['red_packet_amount', 'red_packet_count']);
});
}
};