Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117885809
WalletExpected.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
WalletExpected.php
View Options
<?php
namespace
App\Console\Commands
;
use
Illuminate\Console\Command
;
class
WalletExpected
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'wallet:expected {--user=} {--non-zero}'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'Show expected charges to wallets (for user)'
;
/**
* Create a new command instance.
*
* @return void
*/
public
function
__construct
()
{
parent
::
__construct
();
}
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
if
(
$this
->
option
(
'user'
))
{
$user
=
\App\User
::
where
(
'email'
,
$this
->
option
(
'user'
))
->
orWhere
(
'id'
,
$this
->
option
(
'user'
))->
first
();
if
(!
$user
)
{
return
1
;
}
$wallets
=
$user
->
wallets
;
}
else
{
$wallets
=
\App\Wallet
::
all
();
}
foreach
(
$wallets
as
$wallet
)
{
$charge
=
0
;
$expected
=
$wallet
->
expectedCharges
();
if
(!
$wallet
->
owner
)
{
\Log
::
debug
(
"{$wallet->id} has no owner: {$wallet->user_id}"
);
continue
;
}
if
(
$this
->
option
(
'non-zero'
)
&&
$expected
<
1
)
{
continue
;
}
$this
->
info
(
sprintf
(
"expect charging wallet %s for user %s with %d"
,
$wallet
->
id
,
$wallet
->
owner
->
email
,
$expected
)
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Apr 6, 2:16 AM (1 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
82/6b/94dad11f1fdb38027faa224cb0df
Default Alt Text
WalletExpected.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline