James Cole 2024-07-26 03:57:35 +02:00
parent a0aef5d579
commit 8538741341
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
2 changed files with 10 additions and 0 deletions

View File

@ -554,6 +554,11 @@ class AccountRepository implements AccountRepositoryInterface
++$index;
}
}
// reset the rest to zero.
$all = [AccountType::DEFAULT, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::CREDITCARD, AccountType::MORTGAGE];
$this->user->accounts()->leftJoin('account_types','account_types.id','=','accounts.account_type_id')
->whereNotIn('account_types.type', $all)
->update(['order' => 0]);
}
public function searchAccount(string $query, array $types, int $limit): Collection

View File

@ -241,6 +241,11 @@ class AccountRepository implements AccountRepositoryInterface
++$index;
}
}
// reset the rest to zero.
$all = [AccountType::DEFAULT, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::CREDITCARD, AccountType::MORTGAGE];
$this->user->accounts()->leftJoin('account_types','account_types.id','=','accounts.account_type_id')
->whereNotIn('account_types.type', $all)
->update(['order' => 0]);
}
public function getAccountsByType(array $types, ?array $sort = [], ?array $filters = []): Collection