优化玩游戏中奖权重逻辑
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user