Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/WalletBalances.php
- This file was added.
<?php | |||||
namespace App\Console\Commands; | |||||
use Illuminate\Console\Command; | |||||
class WalletBalances extends Command | |||||
{ | |||||
/** | |||||
* The name and signature of the console command. | |||||
* | |||||
* @var string | |||||
*/ | |||||
protected $signature = 'wallet:balances'; | |||||
/** | |||||
* The console command description. | |||||
* | |||||
* @var string | |||||
*/ | |||||
protected $description = 'Show the balance on wallets'; | |||||
/** | |||||
* Create a new command instance. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function __construct() | |||||
{ | |||||
parent::__construct(); | |||||
} | |||||
/** | |||||
* Execute the console command. | |||||
* | |||||
* @return mixed | |||||
*/ | |||||
public function handle() | |||||
{ | |||||
\App\Wallet::all()->each( | |||||
function ($wallet) { | |||||
if ($wallet->balance == 0) { | |||||
return; | |||||
} | |||||
$user = \App\User::where('id', $wallet->user_id)->first(); | |||||
if (!$user) { | |||||
return; | |||||
} | |||||
$this->info( | |||||
sprintf( | |||||
"%s: %8s (account: %s/%s (%s))", | |||||
$wallet->id, | |||||
machniak: How about "<id>: <balance> (<email>: <url>)"? | |||||
$wallet->balance, | |||||
"https://kolabnow.com/cockpit/admin/accounts/show", | |||||
$user->id, | |||||
Not Done Inline ActionsThe path will be '/user/<id>'. I think we need \App\Utils::serviceAdminUrl() (as we have serviceUrl() already) or add 2nd argument to serviceUrl(). machniak: The path will be '/user/<id>'. I think we need \App\Utils::serviceAdminUrl() (as we have… | |||||
Done Inline ActionsThis is, for now, for our troubleshooting in the migration/transition though. What I want here is that the credit_debit_remaining and other such from the current HKCCP quickly refers to something I can click so as to get to the current HKCCP account page. vanmeeuwen: This is, for now, for our troubleshooting in the migration/transition though.
What I want here… | |||||
$user->email | |||||
) | |||||
); | |||||
} | |||||
); | |||||
} | |||||
} |
How about "<id>: <balance> (<email>: <url>)"?