如果金额为 0,则跳过
This commit is contained in:
parent
acee392f76
commit
266c50f6b1
@ -48,10 +48,16 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
|
|||||||
|
|
||||||
public function toDrops($amount = 1)
|
public function toDrops($amount = 1)
|
||||||
{
|
{
|
||||||
$rate = config('drops.rate');
|
|
||||||
|
|
||||||
$cache_key = 'user_drops_' . $this->id;
|
$cache_key = 'user_drops_' . $this->id;
|
||||||
|
|
||||||
|
if ($amount === 0) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
$rate = config('drops.rate');
|
||||||
|
|
||||||
|
|
||||||
$transactions = new Transaction();
|
$transactions = new Transaction();
|
||||||
|
|
||||||
$drops = $transactions->getDrops($this->id);
|
$drops = $transactions->getDrops($this->id);
|
||||||
|
Loading…
Reference in New Issue
Block a user