功能:自动存点增加金币奖励 + VIP 加成
- heartbeat 增加金币奖励逻辑,读取 jjb_per_heartbeat 配置
- 支持固定值('5')和范围('1-10')两种奖励配置格式
- VIP 会员自动应用经验和金币加成倍率
- 前端手动存点显示金币余额和本次获得的奖励增量
- 新增迁移文件插入 jjb_per_heartbeat 配置项(默认 1-3)
- 更新 exp_per_heartbeat 描述说明支持范围格式
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 文件功能:向 sysparam 表插入金币奖励和经验奖励相关配置项
|
||||
*
|
||||
* 新增 jjb_per_heartbeat(每次心跳金币奖励)配置,
|
||||
* 并更新 exp_per_heartbeat 的描述以说明支持范围格式。
|
||||
*
|
||||
* @author ChatRoom Laravel
|
||||
*
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* 插入金币奖励配置记录,更新经验描述
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
// 金币奖励配置(默认0=关闭,可设为 "1" 或 "1-5" 范围格式)
|
||||
if (! DB::table('sysparam')->where('alias', 'jjb_per_heartbeat')->exists()) {
|
||||
DB::table('sysparam')->insert([
|
||||
'alias' => 'jjb_per_heartbeat',
|
||||
'body' => '1-3',
|
||||
'guidetxt' => '💰 每次心跳金币奖励(支持固定值如"1",或范围如"1-5";设为0关闭)',
|
||||
]);
|
||||
}
|
||||
|
||||
// 更新经验配置描述(说明支持范围格式)
|
||||
DB::table('sysparam')
|
||||
->where('alias', 'exp_per_heartbeat')
|
||||
->update(['guidetxt' => '⚡ 每次心跳经验奖励(支持固定值如"1",或范围如"1-10";设为0关闭)']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 回滚:删除金币配置记录
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
DB::table('sysparam')->where('alias', 'jjb_per_heartbeat')->delete();
|
||||
|
||||
DB::table('sysparam')
|
||||
->where('alias', 'exp_per_heartbeat')
|
||||
->update(['guidetxt' => '每次心跳经验值']);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user