Przeglądaj źródła

fix(shared): 修复小部门PV总和精度计算问题

- 将小部门PV总和数值四舍五入到小数点后两位
- 使用floor函数确保精度处理的一致性
- 避免浮点数精度误差导致的数据展示问题
shichen 5 miesięcy temu
rodzic
commit
d4115ba9f0

+ 1 - 1
app/common/repositories/shared/SharedProsperityUserRepository.php

@@ -282,7 +282,7 @@ class SharedProsperityUserRepository extends BaseRepository
282
             'stats' => [
282
             'stats' => [
283
                 'my_team_total_count' => $myTeamTotalCount,
283
                 'my_team_total_count' => $myTeamTotalCount,
284
                 'my_team_pv_sum' => $myTeamPvSum,
284
                 'my_team_pv_sum' => $myTeamPvSum,
285
-                'small_department_pv_sum' => $smallDepartmentPvSum,
285
+                'small_department_pv_sum' => floor($smallDepartmentPvSum * 100) / 100,
286
                 'big_department_pv_sum' => $bigDepartmentPvSum,
286
                 'big_department_pv_sum' => $bigDepartmentPvSum,
287
             ]
287
             ]
288
         ];
288
         ];