Skip to content

Commit

Permalink
Renaming variable to standard
Browse files Browse the repository at this point in the history
  • Loading branch information
SpeedyD authored Jan 10, 2025
1 parent a3743e4 commit 54a7451
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Models/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,19 +489,19 @@ public function canEditRank($rank) {
*
* @return \Illuminate\Support\Collection
*/
public function getCurrencies($showAll = false, $adminUser = null) {
public function getCurrencies($showAll = false, $user = null) {
// Get a list of currencies that need to be displayed
// On profile: only ones marked is_displayed
// In bank: ones marked is_displayed + the ones the user has

$owned = UserCurrency::where('user_id', $this->id)->pluck('quantity', 'currency_id')->toArray();

$currencies = Currency::where('is_user_owned', 1)
->whereHas('category', function ($query) use ($adminUser) {
$query->visible($adminUser);
->whereHas('category', function ($query) use ($user) {
$query->visible($user);
})
->orWhereNull('currency_category_id')
->visible($adminUser);
->visible($user);
if ($showAll) {
$currencies->where(function ($query) use ($owned) {
$query->where('is_displayed', 1)->orWhereIn('id', array_keys($owned));
Expand Down

0 comments on commit 54a7451

Please sign in to comment.