feat: 马豆全端展示统一为整数格式

这个提交包含在:
chen
2026-09-17 15:22:07 +08:00
父节点 4ac6b9034a
当前提交 4ae2b1688c
共有 11 个文件被更改,包括 65 次插入 和 46 次删除

查看文件

@@ -282,9 +282,9 @@ class DailySettleService
'gmv' => number_format($gmv, 2, '.', ''),
'rate' => number_format($rate, 8, '.', ''),
'madow' => [
'pool' => number_format($madowPool, 2, '.', ''),
'pool' => IdentityService::formatMadow($madowPool),
'user_count' => $tasterCount,
'each' => $madowEach,
'each' => IdentityService::formatMadow($madowEach),
],
'venue' => [
'pool' => number_format($venuePool, 2, '.', ''),

查看文件

@@ -23,6 +23,7 @@ class IdentityService
$level = intval(is_array($agent) ? ($agent['level'] ?? 0) : ($agent->level ?? 0));
$isVenue = intval(is_array($agent) ? ($agent['is_venue'] ?? 0) : ($agent->is_venue ?? 0));
$isCounty = intval(is_array($agent) ? ($agent['is_county'] ?? 0) : ($agent->is_county ?? 0));
$isPartner = intval(is_array($agent) ? ($agent['is_partner'] ?? 0) : ($agent->is_partner ?? 0));
$identities = [];
$parts = [];
@@ -33,35 +34,33 @@ class IdentityService
} elseif ($level >= 2) {
$identities[] = 'maker';
$makerLevelName = '创客V' . ($level - 1);
$parts[] = $makerLevelName;
}
if ($isVenue) {
$identities[] = 'venue';
$parts[] = '酒道馆';
}
if ($isCounty) {
$identities[] = 'county';
$parts[] = '区县代理';
}
if ($isPartner) {
$identities[] = 'partner';
$parts[] = '合伙股东';
}
$isPartner = in_array('maker', $identities) || in_array('venue', $identities) || in_array('county', $identities);
if ($isPartner) {
$parts[] = '合伙股东';
if ($makerLevelName) {
$parts[] = $makerLevelName;
}
if ($isVenue) {
$parts[] = '酒道馆';
}
if ($isCounty) {
$parts[] = '区县代理';
}
} elseif ($level == 1) {
// 若无进阶角色身份且等级为1,则身份为基础品酒师
if (empty($parts) && $level == 1) {
$parts[] = '品酒师';
}
$isAdvanced = ($level >= 2) || ($isVenue == 1) || ($isCounty == 1) || ($isPartner == 1);
return [
'identities' => $identities,
'identity_text' => implode(' · ', $parts),
'is_partner' => $isPartner,
'is_partner' => (bool) $isPartner,
'is_advanced' => $isAdvanced,
'maker_level_name' => $makerLevelName,
];
}
@@ -73,7 +72,7 @@ class IdentityService
public static function formatMadow($value)
{
return number_format((float) $value, 8, '.', '');
return number_format((float) $value, 0, '.', '');
}
public static function formatRate($value)
@@ -127,7 +126,7 @@ class IdentityService
'identities' => [],
'is_partner' => false,
'maker_level_name' => '',
'madow' => '0.00000000',
'madow' => '0',
'madow_rate' => self::formatRate($baseRate),
'madow_value' => '0.00',
'voucher_available' => '0.00',
@@ -141,6 +140,7 @@ class IdentityService
'identity_text' => $full['identity_text'],
'identities' => $full['identities'],
'is_partner' => $full['is_partner'],
'is_advanced' => $full['is_advanced'] ?? false,
'maker_level_name' => $full['maker_level_name'],
'madow' => $full['madow'],
'madow_rate' => $full['madow_rate'],