This commit is contained in:
James Cole 2018-09-26 20:42:07 +02:00
parent fea5510700
commit f87a4c1e7c

View File

@ -315,6 +315,7 @@ class BudgetRepository implements BudgetRepositoryInterface
$set = BudgetLimit::leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
->with(['budget'])
->where('budgets.user_id', $this->user->id)
->whereNull('budgets.deleted_at')
->get(['budget_limits.*']);
return $set;
@ -323,6 +324,7 @@ class BudgetRepository implements BudgetRepositoryInterface
if (null === $start xor null === $end) {
$query = BudgetLimit::leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
->with(['budget'])
->whereNull('budgets.deleted_at')
->where('budgets.user_id', $this->user->id);
if (null !== $end) {
// end date must be before $end.
@ -340,6 +342,7 @@ class BudgetRepository implements BudgetRepositoryInterface
$set = BudgetLimit::leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
->with(['budget'])
->where('budgets.user_id', $this->user->id)
->whereNull('budgets.deleted_at')
->where(
function (Builder $q5) use ($start, $end) {
$q5->where(