CTRL + ALT + L
This commit is contained in:
parent
feb3f10074
commit
6e398c3ddf
|
@ -80,9 +80,9 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||||
*/
|
*/
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'email_verified_at' => 'datetime',
|
'email_verified_at' => 'datetime',
|
||||||
'last_seen' => 'datetime',
|
'last_seen' => 'datetime',
|
||||||
'credits' => 'float',
|
'credits' => 'float',
|
||||||
'server_limit' => 'float',
|
'server_limit' => 'float',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -248,18 +248,20 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function outOfCredits()
|
public function outOfCredits()
|
||||||
{
|
{
|
||||||
$usage = $this->creditUsage();
|
$usage = $this->creditUsage();
|
||||||
$credits = $this->credits;
|
$credits = $this->credits;
|
||||||
$timeLeft = number_format(($credits*30)/$usage);
|
$timeLeft = number_format(($credits * 30) / $usage);
|
||||||
$unit = "days";
|
$unit = "days";
|
||||||
|
|
||||||
if($timeLeft < 1){
|
if ($timeLeft < 1) {
|
||||||
$timeLeft = number_format(($credits*30)/$usage*24,2);
|
$timeLeft = number_format(($credits * 30) / $usage * 24, 2);
|
||||||
$unit = "hours";
|
$unit = "hours";
|
||||||
}
|
}
|
||||||
return $timeLeft." ".$unit;
|
return $timeLeft . " " . $unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue