修改DiceLotteryPoolConfig-type改为name映射
This commit is contained in:
@@ -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 = [
|
||||
|
||||
@@ -333,7 +333,7 @@ class DiceRewardConfigLogic extends BaseLogic
|
||||
$config = DiceLotteryPoolConfig::find($lotteryConfigId);
|
||||
}
|
||||
if (!$config) {
|
||||
$config = DiceLotteryPoolConfig::where('type', 0)->find();
|
||||
$config = DiceLotteryPoolConfig::where('name', 'default')->find();
|
||||
}
|
||||
if ($config) {
|
||||
$tierWeights = [
|
||||
|
||||
Reference in New Issue
Block a user