This commit is contained in:
hackerESQ
2025-08-11 19:58:17 -05:00
parent 9260de5f25
commit 97b13063d9
4 changed files with 64 additions and 141 deletions
@@ -53,22 +53,7 @@ new class extends Component
$dailyChangeQuery->whereDate('daily_change.date', '>=', now()->{$filterMethod['method']}(...$filterMethod['args']));
}
$dailyChange = $dailyChangeQuery->get();
$dailyChange = $dailyChange
->sortBy('date')
->groupBy('date')
->map(function ($group) {
return (object) [
'date' => $group->first()->date->toDateString(),
'total_market_value' => $group->sum('total_market_value'),
'total_cost_basis' => $group->sum('total_cost_basis'),
'total_gain' => $group->sum('total_gain'),
'realized_gain_dollars' => $group->sum('realized_gain_dollars'),
'total_dividends_earned' => $group->sum('total_dividends_earned'),
];
})
->values();
$dailyChange = $dailyChangeQuery->getDailyPerformance();
return [
'series' => [