wip
This commit is contained in:
@@ -53,7 +53,13 @@ new class extends Component
|
|||||||
$dailyChangeQuery->whereDate('daily_change.date', '>=', now()->{$filterMethod['method']}(...$filterMethod['args']));
|
$dailyChangeQuery->whereDate('daily_change.date', '>=', now()->{$filterMethod['method']}(...$filterMethod['args']));
|
||||||
}
|
}
|
||||||
|
|
||||||
$dailyChange = $dailyChangeQuery->getDailyPerformance();
|
$dailyChange = cache()->remember(
|
||||||
|
'graph-'.(isset($this->portfolio) ? $this->portfolio->id : request()->user()->id),
|
||||||
|
30,
|
||||||
|
function () use ($dailyChangeQuery) {
|
||||||
|
return $dailyChangeQuery->getDailyPerformance();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'series' => [
|
'series' => [
|
||||||
@@ -86,6 +92,8 @@ new class extends Component
|
|||||||
{
|
{
|
||||||
$this->scope = $scope;
|
$this->scope = $scope;
|
||||||
|
|
||||||
|
cache()->forget('graph-'.isset($this->portfolio) ? $this->portfolio->id : request()->user()->id);
|
||||||
|
|
||||||
$this->chartSeries = $this->generatePerformanceData();
|
$this->chartSeries = $this->generatePerformanceData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user