feat: 高考志愿与定价分销链路更新(管理端/API/小程序)
- 新增高考志愿核心服务、模型、控制器与迁移脚本 - 同步管理端定价/分销/设置与小程序入口、历史、测试选择和支付逻辑 - 补充相关开发文档 Made-with: Cursor
This commit is contained in:
@@ -753,7 +753,7 @@ class Distribution extends BaseController
|
||||
private static function defaultTestSettings(): array
|
||||
{
|
||||
$item = ['enabled' => true, 'commissionType' => 'ratio', 'commissionRate' => 90, 'commissionAmountFen' => 0, 'noPayment' => false];
|
||||
return ['face' => $item, 'mbti' => $item, 'sbti' => $item, 'disc' => $item, 'pdp' => $item];
|
||||
return ['face' => $item, 'mbti' => $item, 'sbti' => $item, 'disc' => $item, 'pdp' => $item, 'gaokao' => $item];
|
||||
}
|
||||
|
||||
private static function sanitizeTestSettings($raw): array
|
||||
@@ -832,12 +832,13 @@ class Distribution extends BaseController
|
||||
}
|
||||
|
||||
$totals = [
|
||||
'face' => 0,
|
||||
'mbti' => 0,
|
||||
'sbti' => 0,
|
||||
'disc' => 0,
|
||||
'pdp' => 0,
|
||||
'other' => 0,
|
||||
'face' => 0,
|
||||
'mbti' => 0,
|
||||
'sbti' => 0,
|
||||
'disc' => 0,
|
||||
'pdp' => 0,
|
||||
'gaokao' => 0,
|
||||
'other' => 0,
|
||||
];
|
||||
|
||||
foreach ($records as $record) {
|
||||
@@ -860,6 +861,7 @@ class Distribution extends BaseController
|
||||
['label' => 'SBTI', 'value' => round($totals['sbti'] / 100, 2)],
|
||||
['label' => 'DISC', 'value' => round($totals['disc'] / 100, 2)],
|
||||
['label' => 'PDP', 'value' => round($totals['pdp'] / 100, 2)],
|
||||
['label' => '高考志愿', 'value' => round($totals['gaokao'] / 100, 2)],
|
||||
['label' => '其他', 'value' => round($totals['other'] / 100, 2)],
|
||||
];
|
||||
}
|
||||
@@ -870,7 +872,7 @@ class Distribution extends BaseController
|
||||
if ($normalized === 'ai') {
|
||||
return 'face';
|
||||
}
|
||||
if (in_array($normalized, ['face', 'mbti', 'sbti', 'disc', 'pdp'], true)) {
|
||||
if (in_array($normalized, ['face', 'mbti', 'sbti', 'disc', 'pdp', 'gaokao'], true)) {
|
||||
return $normalized;
|
||||
}
|
||||
return 'other';
|
||||
@@ -879,12 +881,13 @@ class Distribution extends BaseController
|
||||
private static function getTestTypeLabel(string $testType): string
|
||||
{
|
||||
$map = [
|
||||
'face' => '人脸',
|
||||
'mbti' => 'MBTI',
|
||||
'sbti' => 'SBTI',
|
||||
'disc' => 'DISC',
|
||||
'pdp' => 'PDP',
|
||||
'other' => '其他',
|
||||
'face' => '人脸',
|
||||
'mbti' => 'MBTI',
|
||||
'sbti' => 'SBTI',
|
||||
'disc' => 'DISC',
|
||||
'pdp' => 'PDP',
|
||||
'gaokao' => '高考志愿',
|
||||
'other' => '其他',
|
||||
];
|
||||
|
||||
return $map[$testType] ?? strtoupper($testType ?: '其他');
|
||||
|
||||
Reference in New Issue
Block a user