刷新数据 2026-09-14 12:44

This commit is contained in:
FANGKK
2026-09-14 12:44:11 +08:00
parent 008dd12715
commit f825240e17
+3 -1
View File
@@ -285,7 +285,9 @@ function derive(d) {
const bStart = [d.range.start, recharges[0] && recharges[0].date].filter(Boolean).sort()[0]; const bStart = [d.range.start, recharges[0] && recharges[0].date].filter(Boolean).sort()[0];
let cumSpend = 0, cumIn = 0; let cumSpend = 0, cumIn = 0;
const balanceSeries = dayRange(bStart, end).map(dt => { // 充值日期可能晚于最后一天的消耗数据,走势图画到两者中较晚的那天,才和顶部余额一致
const bEnd = [end, recharges.length ? recharges[recharges.length - 1].date : end].sort().pop();
const balanceSeries = dayRange(bStart, bEnd).map(dt => {
const spend = r2(rowsOn(dt).reduce((s, r) => s + r.spend, 0)); const spend = r2(rowsOn(dt).reduce((s, r) => s + r.spend, 0));
const inflow = r2(recharges.filter(x => x.date === dt).reduce((s, x) => s + x.amount, 0)); const inflow = r2(recharges.filter(x => x.date === dt).reduce((s, x) => s + x.amount, 0));
cumSpend += spend; cumSpend += spend;