Files
lotteryLaravel/app/Support/Settlement/DesignDocExample12.php
kang e3ffffad9c feat: 增强代理和玩家管理功能
- 在 SyncAdminAuthorizationCommand 中新增对代理线路和结算菜单操作的同步功能,确保缺失的菜单操作行能够被创建。
- 更新多个控制器中的权限检查逻辑,使用 hasPermissionCode 替代原有的权限验证方式,提升权限管理的灵活性。
- 在 AdminPlayerStoreController 中引入对玩家创建能力的验证,确保只有具备相应权限的管理员能够创建玩家。
- 更新请求验证逻辑,新增 credit_limit、rebate_rate 和 extra_rebate_rate 字段,以支持更细粒度的玩家管理。
- 在 AdminUser 和 AgentNode 模型中增强角色与用户的权限管理功能,支持更细粒度的权限控制。
2026-06-04 09:17:47 +08:00

73 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Support\Settlement;
/**
* 设计文档 §12.1§12.4 验收常量(平台视角:玩家输为正)。
*
* @see docs/信用占成盘代理系统设计说明文档.md
*/
final class DesignDocExample12
{
public const GAME_WIN_LOSS = 1000;
public const BASIC_REBATE = 50;
public const EXTRA_REBATE_BY_C = 20;
/** 玩家净结算 P→C1000 - 50 - 20 */
public const PLAYER_NET_SETTLEMENT = 930;
/** 共享净输赢1000 - 50 */
public const SHARED_NET_WIN_LOSS = 950;
/** 总占成A=60%, B=40%, C=25% */
public const TOTAL_SHARE_A = 60;
public const TOTAL_SHARE_B = 40;
public const TOTAL_SHARE_C = 25;
/** 实际占成收益(共享池) */
public const SHARE_PROFIT_C = 237.5;
public const SHARE_PROFIT_B = 142.5;
public const SHARE_PROFIT_A = 190.0;
public const SHARE_PROFIT_PLATFORM = 380.0;
/** C 最终收益237.5 - 20 */
public const FINAL_PROFIT_C = 217.5;
/** 逐级结算应付 */
public const TIER_P_TO_C = 930.0;
public const TIER_C_TO_B = 712.5;
public const TIER_B_TO_A = 570.0;
public const TIER_A_TO_PLATFORM = 380.0;
/**
* @return array{actual: array<string, float>, total: float}
*/
public static function actualShareRates(): array
{
$c = self::TOTAL_SHARE_C;
$b = self::TOTAL_SHARE_B - self::TOTAL_SHARE_C;
$a = self::TOTAL_SHARE_A - self::TOTAL_SHARE_B;
$platform = 100 - self::TOTAL_SHARE_A;
return [
'actual' => [
'C' => $c,
'B' => $b,
'A' => $a,
'platform' => $platform,
],
'total' => $c + $b + $a + $platform,
];
}
}