input('date', today()->toDateString()); // 各来源活动产出统计(按 source + currency 分组汇总) $stats = $this->currencyService->activityStats($date); // 按货币类型分组,方便视图展示 $statsByType = $stats->groupBy('currency')->map( fn ($rows) => $rows->keyBy('source') ); // 今日净流通量(正向增加 - 负向消耗),可判断通货膨胀 $netFlow = $this->currencyService->netFlowStats($date); // 所有已知来源(供视图展示缺失来源的空行) $allSources = CurrencySource::cases(); return view('admin.currency-stats.index', compact( 'date', 'stats', 'statsByType', 'netFlow', 'allSources', )); } }