diff --git a/app/src/Repository/WalletRepository.php b/app/src/Repository/WalletRepository.php index 1bb1c92..e3444de 100644 --- a/app/src/Repository/WalletRepository.php +++ b/app/src/Repository/WalletRepository.php @@ -43,9 +43,12 @@ public function findAllByUserPKByArchived(int $userID, bool $isArchived = false) public function findByUserPKLatestWithLimit(int $userID, int $limit = 4): array { /** @var \App\Database\Wallet[] $wallets */ - $wallets = $this->allByUserPK($userID) - ->limit($limit) + $wallets = $this->select() + ->load('users') + ->where('users.id', $userID) + ->orderBy('is_archived') ->orderBy('updated_at', 'DESC') + ->limit($limit) ->fetchAll(); return $wallets;