如果金额为 0,则跳过

This commit is contained in:
iVampireSP.com 2022-09-23 20:27:24 +08:00
parent acee392f76
commit 266c50f6b1
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -48,10 +48,16 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
public function toDrops($amount = 1)
{
$rate = config('drops.rate');
$cache_key = 'user_drops_' . $this->id;
if ($amount === 0) {
return $this;
}
$rate = config('drops.rate');
$transactions = new Transaction();
$drops = $transactions->getDrops($this->id);