修改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

@@ -38,11 +38,11 @@ class DiceLotteryPoolConfigLogic extends BaseLogic
*/
public function getCurrentPool(): array
{
$configType0 = DiceLotteryPoolConfig::where('type', 0)->find();
$configType0 = DiceLotteryPoolConfig::where('name', 'default')->find();
if (!$configType0) {
throw new ApiException('未找到 type=0 的奖池配置,请先创建');
throw new ApiException('未找到 name=default 的奖池配置,请先创建');
}
$configType1 = DiceLotteryPoolConfig::where('type', 1)->find();
$configType1 = DiceLotteryPoolConfig::where('name', 'killScore')->find();
$row0 = $configType0->toArray();
$profitAmount = isset($row0['profit_amount']) ? (float) $row0['profit_amount'] : (isset($row0['ev']) ? (float) $row0['ev'] : 0.0);
$pool = [