修改DiceLotteryPoolConfig-type改为name映射

This commit is contained in:
2026-03-17 17:09:10 +08:00
parent d4cf708bc1
commit e7b8f4cae9
18 changed files with 64 additions and 115 deletions

View File

@@ -56,8 +56,8 @@ class LotteryService
if (!$player) {
throw new \RuntimeException('玩家不存在');
}
$config0 = DiceLotteryPoolConfig::where('type', 0)->find();
$config1 = DiceLotteryPoolConfig::where('type', 1)->find();
$config0 = DiceLotteryPoolConfig::where('name', 'default')->find();
$config1 = DiceLotteryPoolConfig::where('name', 'killScore')->find();
$s = new self($playerId);
$s->configType0Id = $config0 ? (int) $config0->id : null;
$s->configType1Id = $config1 ? (int) $config1->id : null;