优化玩游戏中奖权重逻辑

This commit is contained in:
2026-03-10 16:27:11 +08:00
parent 296991f53a
commit e56c3ada34
8 changed files with 539 additions and 36 deletions

View File

@@ -123,4 +123,35 @@ class DiceRewardConfigController extends BaseController
}
}
/**
* T1-T5、BIGWIN 权重配比:按档位分组返回配置列表
* @param Request $request
* @return Response
*/
#[Permission('奖励配置列表', 'dice:reward_config:index:index')]
public function weightRatioList(Request $request): Response
{
$data = $this->logic->getListGroupedByTier();
return $this->success($data);
}
/**
* T1-T5、BIGWIN 权重配比批量更新权重T1-T5 同档位权重和须为 100%BIGWIN 为豹子权重单独设定、无合计要求)
* @param Request $request
* @return Response
*/
#[Permission('奖励配置修改', 'dice:reward_config:index:update')]
public function batchUpdateWeights(Request $request): Response
{
$items = $request->post('items', []);
if (!is_array($items)) {
return $this->fail('参数 items 必须为数组');
}
try {
$this->logic->batchUpdateWeights($items);
return $this->success('保存成功');
} catch (\plugin\saiadmin\exception\ApiException $e) {
return $this->fail($e->getMessage());
}
}
}