id(); $table->string('alias', 100)->unique()->comment('参数别名(唯一标识)'); $table->text('body')->nullable()->comment('参数值'); $table->string('guidetxt', 500)->nullable()->comment('参数说明(后台显示)'); $table->timestamps(); }); // 插入默认的等级经验配置(管理员可在后台修改) // 格式:逗号分隔,每项为"等级所需的累计经验值" // 例如:等级1需要10经验,等级2需要50,等级3需要150... DB::table('sysparam')->insert([ [ 'alias' => 'levelexp', 'body' => '10,50,150,400,800,1500,3000,5000,8000,12000,18000,25000,35000,50000,80000', 'guidetxt' => '等级经验阈值配置(逗号分隔)。第N个数字表示升到N级所需的累计经验值。例如:10,50,150 表示1级需10经验,2级需50经验,3级需150经验。', 'created_at' => now(), 'updated_at' => now(), ], [ 'alias' => 'exp_per_heartbeat', 'body' => '1', 'guidetxt' => '每次心跳(约60秒)增加的经验值', 'created_at' => now(), 'updated_at' => now(), ], [ 'alias' => 'superlevel', 'body' => '16', 'guidetxt' => '管理员级别(= 最高等级 + 1,拥有最高权限的等级阈值)', 'created_at' => now(), 'updated_at' => now(), ], [ 'alias' => 'maxlevel', 'body' => '15', 'guidetxt' => '用户最高可达等级', 'created_at' => now(), 'updated_at' => now(), ], ]); } /** * 回滚:删除 sysparam 表 */ public function down(): void { Schema::dropIfExists('sysparam'); } };