improve import / export flow and clean up relationships
This commit is contained in:
hackerESQ
2024-08-28 22:06:47 -05:00
parent e684c1f4a3
commit 69c43dc41f
15 changed files with 104 additions and 74 deletions
+3 -2
View File
@@ -56,7 +56,8 @@ class Holding extends Model
public function transactions()
{
return $this->hasMany(Transaction::class, 'symbol', 'symbol')
->where('transactions.portfolio_id', $this->portfolio_id);
->where('portfolio_id', $this->portfolio_id)
->withAggregate('portfolio', 'title');
}
/**
@@ -141,7 +142,7 @@ class Holding extends Model
public function scopeSymbol($query, $symbol)
{
return $query->where('symbol', $symbol);
return $query->where('holdings.symbol', $symbol);
}
public function scopeWithoutWishlists($query) {