mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 02:15:07 +08:00
fix(product): 修复产品列表中点数显示问题
- 在 RechargeProductsDto 类中,修改了 bonus_rate_pct 的计算方式 - 使用 round 函数对结果进行四舍五入,提高精度 - 调整 scale 参数为3,增加小数位数- 这些修改提高了点数计算的准确性,解决了产品列表中的点数显示问题
This commit is contained in:
@@ -54,17 +54,19 @@ final class RechargeProductsDto extends AbstractDto
|
||||
if (!$is_ftai) {
|
||||
$result += [
|
||||
'total_points' => $effect->getPointTotal(),
|
||||
'bonus_rate_pct' => (float)(bcmul(
|
||||
num1: $effect->getPointTotal() == 0
|
||||
? '0'
|
||||
: bcdiv(
|
||||
(string)$effect->pointBonus,
|
||||
(string)$effect->getPointTotal(),
|
||||
3,
|
||||
),
|
||||
num2: '100',
|
||||
scale: 0,
|
||||
)),
|
||||
'bonus_rate_pct' => round(
|
||||
(float)(bcmul(
|
||||
num1: $effect->getPointTotal() == 0
|
||||
? '0'
|
||||
: bcdiv(
|
||||
(string)$effect->pointBonus,
|
||||
(string)$effect->getPointTotal(),
|
||||
3,
|
||||
),
|
||||
num2: '100',
|
||||
scale: 3,
|
||||
)),
|
||||
),
|
||||
'point' => [
|
||||
'total' => $effect->getPointTotal(),
|
||||
'number' => $effect->pointBasic,
|
||||
|
||||
Reference in New Issue
Block a user