Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/WalletBalances.php
Show All 23 Lines | class WalletBalances extends Command | ||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$wallets = \App\Wallet::select('wallets.*') | $wallets = \App\Wallet::select('wallets.*') | ||||
->join('users', 'users.id', '=', 'wallets.user_id') | ->join('users', 'users.id', '=', 'wallets.user_id') | ||||
->withEnvTenant('users') | ->withEnvTenantContext('users') | ||||
->all(); | ->all(); | ||||
$wallets->each( | $wallets->each( | ||||
function ($wallet) { | function ($wallet) { | ||||
if ($wallet->balance == 0) { | if ($wallet->balance == 0) { | ||||
return; | return; | ||||
} | } | ||||
Show All 20 Lines |