功能更新与UI优化:游戏图标移除、用户名片修复、婚礼红包界面重设计
- 移除聊天室右下角浮动游戏图标(占卜、百家乐、赛马、老虎机) - 用户名片按钮区:修复已婚/已好友时按钮换行问题,统一单行显示 - 婚礼红包弹窗:重设计为喜庆鲜红背景,领取按钮改为圆形米黄样式 - 新增婚礼红包恢复接口(/wedding/pending-envelopes),刷新后自动恢复领取按钮 - 修复 Alpine :style 字符串覆盖静态 style 导致圆形按钮失效的问题 - 撤职后用户等级改为根据经验值重新计算,不再无条件重置为1 - 管理员修改用户经验值后自动重算等级,有职务用户等级锁定 - 娱乐大厅钓鱼游戏按钮直接调用 startFishing() 简化操作流程 - 新增赛马、占卜、百家乐游戏及相关后端逻辑
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 文件功能:赛马竞猜局次表迁移
|
||||
*
|
||||
* 记录每场赛马比赛的状态、参赛马匹、赢家结果
|
||||
* 以及下注统计等信息。
|
||||
*
|
||||
* @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
|
||||
{
|
||||
/**
|
||||
* 创建 horse_races 表。
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('horse_races', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
// 场次状态:betting(押注中)| running(跑马中)| settled(已结算)
|
||||
$table->string('status', 20)->default('betting')->index();
|
||||
|
||||
// 押注时间窗口
|
||||
$table->timestamp('bet_opens_at')->nullable();
|
||||
$table->timestamp('bet_closes_at')->nullable();
|
||||
|
||||
// 跑马开始和结束时间
|
||||
$table->timestamp('race_starts_at')->nullable();
|
||||
$table->timestamp('race_ends_at')->nullable();
|
||||
|
||||
// 参赛马匹(JSON 数组:[{id, name, emoji, odds}])
|
||||
$table->json('horses')->nullable();
|
||||
|
||||
// 获胜马匹 ID(1~N)
|
||||
$table->tinyInteger('winner_horse_id')->nullable();
|
||||
|
||||
// 本场统计
|
||||
$table->unsignedBigInteger('total_bets')->default(0); // 总参与人次
|
||||
$table->unsignedBigInteger('total_pool')->default(0); // 注池总金额
|
||||
|
||||
$table->timestamp('settled_at')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 回滚。
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('horse_races');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 文件功能:神秘占卜记录表迁移
|
||||
*
|
||||
* 记录每次用户占卜的签文类型、签文内容、
|
||||
* 当日 buff 效果及消耗金币记录。
|
||||
*
|
||||
* @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
|
||||
{
|
||||
/**
|
||||
* 创建 fortune_logs 表。
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('fortune_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
// 占卜用户
|
||||
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
|
||||
|
||||
// 签文类型:jackpot(上上签)| good(上签)| normal(中签)| bad(下签)| curse(大凶签)
|
||||
$table->string('grade', 20);
|
||||
|
||||
// 签文内容(预设文字)
|
||||
$table->string('text', 500);
|
||||
|
||||
// 当日加成描述(例如:"今日经验+20%")
|
||||
$table->string('buff_desc', 200)->nullable();
|
||||
|
||||
// 是否为免费次数(false=付费额外次数)
|
||||
$table->boolean('is_free')->default(true);
|
||||
|
||||
// 占卜消耗金币(免费次数为 0)
|
||||
$table->unsignedInteger('cost')->default(0);
|
||||
|
||||
// 占卜日期(用于计算每日首次)
|
||||
$table->date('fortune_date');
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
// 加速每日次数查询
|
||||
$table->index(['user_id', 'fortune_date']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 回滚。
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('fortune_logs');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 文件功能:赛马竞猜下注记录表迁移
|
||||
*
|
||||
* 记录每场比赛中每位用户的下注信息,
|
||||
* 包括押注的马匹、金额、结果和赔付金额。
|
||||
*
|
||||
* @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
|
||||
{
|
||||
/**
|
||||
* 创建 horse_bets 表。
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('horse_bets', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
// 关联赛事
|
||||
$table->foreignId('race_id')->constrained('horse_races')->cascadeOnDelete();
|
||||
|
||||
// 下注用户
|
||||
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
|
||||
|
||||
// 押注的马匹 ID(1~N)
|
||||
$table->tinyInteger('horse_id');
|
||||
|
||||
// 下注金额
|
||||
$table->unsignedBigInteger('amount');
|
||||
|
||||
// 状态:pending(待开奖)| won(中奖)| lost(未中)
|
||||
$table->string('status', 20)->default('pending');
|
||||
|
||||
// 实际赔付金额(含本金返还,lost 时为 0)
|
||||
$table->unsignedBigInteger('payout')->default(0);
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
// 每场每人只能押注一次
|
||||
$table->unique(['race_id', 'user_id']);
|
||||
|
||||
// 加速查询
|
||||
$table->index('status');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 回滚。
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('horse_bets');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user