Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/WalletCharge.php
Show All 35 Lines | public function handle() | ||||
return 1; | return 1; | ||||
} | } | ||||
$wallets = [$wallet]; | $wallets = [$wallet]; | ||||
} else { | } else { | ||||
// Get all wallets, excluding deleted accounts | // Get all wallets, excluding deleted accounts | ||||
$wallets = Wallet::select('wallets.*') | $wallets = Wallet::select('wallets.*') | ||||
->join('users', 'users.id', '=', 'wallets.user_id') | ->join('users', 'users.id', '=', 'wallets.user_id') | ||||
->withEnvTenant('users') | ->withEnvTenantContext('users') | ||||
->whereNull('users.deleted_at') | ->whereNull('users.deleted_at') | ||||
->cursor(); | ->cursor(); | ||||
} | } | ||||
foreach ($wallets as $wallet) { | foreach ($wallets as $wallet) { | ||||
$charge = $wallet->chargeEntitlements(); | $charge = $wallet->chargeEntitlements(); | ||||
if ($charge > 0) { | if ($charge > 0) { | ||||
Show All 15 Lines |