This commit is contained in:
hackerESQ
2025-08-21 21:46:53 -05:00
parent 5611de0e2e
commit ac310735df
2 changed files with 5 additions and 2 deletions
+2 -2
View File
@@ -42,9 +42,9 @@ class DailyChange extends Model
return $query->where('daily_change.portfolio_id', $portfolio);
}
public function scopeMyDailyChanges()
public function scopeMyDailyChanges($query)
{
return $this->whereHas('portfolio', function ($query) {
return $query->whereHas('portfolio', function ($query) {
$query->whereHas('users', function ($query) {
return $query->where('id', auth()->id());
});
+3
View File
@@ -218,6 +218,9 @@ class Portfolio extends Model
);
});
}
cache()->forget('graph-YTD-'.$this->id);
cache()->forget('graph-YTD-'.request()->user()->id);
}
protected function getMostRecentCloseData($history, $date, $i = 0, $max_attempts = 5)