feat(odds): 支持基于开注商的赔率区分与优先级处理
- 在赔率数据表中新增 provider_code 字段,默认值为 GLOBAL - 赔率接口与服务中新增 provider_code 参数支持,实现开注商特定赔率加载 - 解析赔率集合时,根据 provider_code 优先级进行排序与筛选,保证特定开注商赔率优先 - 优化赔率唯一索引,新增 provider_code 列以防止不同开注商赔率重复冲突 - 调整赔率相关验证规则,支持开注商代码的合法性与可选性检查 - 玩法解析与出票相关逻辑改造,支持多开注商环境下的投注处理 - 管理界面赔率替换接口增加 provider_code 字段支持 - 同步和测试用例覆盖 provider_code 相关功能,验证开注商赔率隔离与优先切换 - PlayEffectiveCatalogController 支持按 provider_code 返回赔率目录数据 - TicketPlacementService 与 TicketPreviewService 修改为支持 provider_code 多开注商玩法解析 - 维护 OddsStandardScopes 同步逻辑,保证开注商维度佣金与赔率正确同步 - AdminConfigPresenter 增加了对应数据的 provider_code 与 dimension 输出字段 - SDK接口添加 odds_snapshot_json 中开注商字段,完善赔率快照信息 - 路由配置调整管理文档地址,无关改动细微修改
This commit is contained in:
@@ -37,8 +37,10 @@ final class OddsItemsReplaceController extends Controller
|
||||
|
||||
$data = $request->validate([
|
||||
'items' => ['required', 'array', 'min:1'],
|
||||
'items.*.provider_code' => ['sometimes', 'string', 'max:32'],
|
||||
'items.*.play_code' => ['required', 'string', 'max:32', Rule::exists('play_types', 'play_code')],
|
||||
'items.*.prize_scope' => ['required', 'string', 'max:32'],
|
||||
'items.*.dimension' => ['sometimes', 'nullable', 'integer', 'in:2,3,4'],
|
||||
'items.*.odds_value' => ['required', 'integer', 'min:0'],
|
||||
'items.*.rebate_rate' => ['sometimes', 'numeric', 'between:0,1'],
|
||||
'items.*.commission_rate' => ['sometimes', 'numeric', 'between:0,1'],
|
||||
|
||||
@@ -80,6 +80,7 @@ final class AdminTicketItemShowController extends Controller
|
||||
'actual_deduct_amount_minor' => $actualDeduct,
|
||||
'actual_deduct_amount_formatted' => CurrencyFormatter::fromMinor($actualDeduct),
|
||||
'risk_locked_amount' => (int) $item->risk_locked_amount,
|
||||
'odds_snapshot_json' => $item->odds_snapshot_json,
|
||||
'status' => $item->status,
|
||||
'fail_reason_code' => $item->fail_reason_code,
|
||||
'fail_reason_text' => $item->fail_reason_text,
|
||||
|
||||
@@ -20,9 +20,11 @@ final class PlayEffectiveCatalogController extends Controller
|
||||
{
|
||||
$currency = $request->query('currency');
|
||||
$c = is_string($currency) && $currency !== '' ? $currency : null;
|
||||
$provider = $request->query('provider_code');
|
||||
$providerCode = is_string($provider) && $provider !== '' ? $provider : null;
|
||||
|
||||
try {
|
||||
return ApiResponse::success($catalog->build($c));
|
||||
return ApiResponse::success($catalog->build($c, $providerCode));
|
||||
} catch (ModelNotFoundException) {
|
||||
return ApiMessage::errorResponse($request, 'effective_config_not_initialized', ErrorCode::NotFound->value, null, 404);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
|
||||
Reference in New Issue
Block a user