From b7f674b097264ca1417eadbde75e18d3ceb32148 Mon Sep 17 00:00:00 2001 From: zhx Date: Sun, 24 May 2026 14:08:31 +0800 Subject: [PATCH] fix: calculate dashboard summary profit rate --- apps/src/views/statistics/datav.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/src/views/statistics/datav.vue b/apps/src/views/statistics/datav.vue index a8dc05e..c03c507 100644 --- a/apps/src/views/statistics/datav.vue +++ b/apps/src/views/statistics/datav.vue @@ -761,6 +761,10 @@ function resolveLuckyGiftProfitRate(record?: null | { if (!record) { return 0; } + const flow = toAmount(record.luckyGiftTotalFlow); + if (flow !== 0) { + return (toAmount(record.luckyGiftProfit) / flow) * 100; + } if ( record.luckyGiftProfitRate !== undefined && record.luckyGiftProfitRate !== null && @@ -771,11 +775,7 @@ function resolveLuckyGiftProfitRate(record?: null | { return rate; } } - const flow = Number(record.luckyGiftTotalFlow || 0); - if (!Number.isFinite(flow) || flow === 0) { - return 0; - } - return (Number(record.luckyGiftProfit || 0) / flow) * 100; + return 0; } function resolveMetricRate(record: Record, key: string) {