Skip to content

Commit

Permalink
Merge pull request #66 from cash-track/feature/profile-statistics
Browse files Browse the repository at this point in the history
Feature / Profile Statistics
  • Loading branch information
vokomarov authored Oct 16, 2021
2 parents 827bd45 + 8b1ea44 commit 5b1ef2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/src/Repository/WalletRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5b1ef2e

Please sign in to comment.