任务时间: 2025年06月19日 01:31:16
任务类型: 功能扩展
模块: URS推广模块
状态: ✅ 已完成
扩展URS转账手续费配置系统,从原来只支持转出操作扩展为同时支持转入和转出两种转账类型,实现差异化的手续费管理策略。
transfer_type字段到urs_promotion_transfer_fee_configs表idx_type_house_talent_status优化查询性能UrsTransferFeeConfig模型添加transfer_type字段TransferType枚举类定义转账类型常量UrsTransferFeeService支持转账类型参数getBestFeeRateForUser方法支持转入/转出类型calculateBestFeeRate方法支持转账类型筛选UrsTransferFeeLogic类支持转账类型查询UrsTransferFeeConfigDto添加transferType属性fromModel方法处理新字段-- 添加转账类型字段
ALTER TABLE `kku_urs_promotion_transfer_fee_configs`
ADD COLUMN `transfer_type` ENUM('in', 'out') NOT NULL DEFAULT 'out'
COMMENT '转账类型:in转入,out转出' AFTER `talent_level`;
-- 添加复合索引
ALTER TABLE `kku_urs_promotion_transfer_fee_configs`
ADD INDEX `idx_type_house_talent_status` (`transfer_type`, `house_level`, `talent_level`, `status`);
// 获取用户转出费率
$outRate = UrsTransferFeeService::getBestFeeRateForUser($userId, 'out');
// 获取用户转入费率
$inRate = UrsTransferFeeService::getBestFeeRateForUser($userId, 'in');
// 直接计算等级费率
$feeRate = UrsTransferFeeService::calculateBestFeeRate($houseLevel, $talentLevel, 'out');
urs_transfer_fee_rate:{userId}:{transferType}# 测试结果示例
用户ID 10002 转出费率: 5%
用户ID 10002 转入费率: 0%
房屋7级+达人0级 转出费率: 4%
房屋7级+达人0级 转入费率: 0%
房屋0级+达人5级 转出费率: 2%
房屋0级+达人5级 转入费率: 0%
app/Module/UrsPromotion/Enums/TransferType.php - 转账类型枚举app/Module/UrsPromotion/Docs/转账手续费配置.md - 专项文档app/Module/UrsPromotion/Databases/GenerateSql/extend_transfer_fee_config_for_transfer_in.sql - 数据库变更SQLapp/Module/UrsPromotion/Models/UrsTransferFeeConfig.php - 模型扩展app/Module/UrsPromotion/Services/UrsTransferFeeService.php - 服务层扩展app/Module/UrsPromotion/Logic/UrsTransferFeeLogic.php - 逻辑层更新app/Module/UrsPromotion/Dto/UrsTransferFeeConfigDto.php - DTO更新app/Module/UrsPromotion/Admin/Controllers/UrsTransferFeeConfigController.php - 后台控制器app/Module/UrsPromotion/README.md - 主文档更新app/Module/UrsPromotion/Docs/服务层使用示例.md - 使用示例更新本次任务成功扩展了URS转账手续费配置系统,实现了转入和转出两种转账类型的差异化费率管理。通过完善的数据库设计、服务层接口、后台管理界面和详细文档,为业务提供了灵活、高效的费率配置解决方案。
系统现在支持:
所有功能经过充分测试验证,代码质量良好,文档完善,可以投入生产使用。