feat: 马豆全端展示统一为整数格式
这个提交包含在:
@@ -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'],
|
||||
|
||||
在新工单中引用
屏蔽一个用户