Explorar el Código

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

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

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

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