保留 8 位

This commit is contained in:
iVampireSP.com 2022-10-15 09:59:34 +08:00
parent 6c152a2d43
commit dae507198d
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
3 changed files with 7 additions and 3 deletions

View File

@ -99,7 +99,7 @@ public function cost($price = null, $auto = true)
$this->price = $price;
}
$this->price = round($this->price, 5);
$this->price = round($this->price, 8);
$amount = $price / config('drops.rate') + 1;

View File

@ -83,8 +83,8 @@ public function getDrops($user_id = null)
'drops' => 0,
]);
// 保留 5
$drops['drops'] = round($drops['drops'], 5);
// 保留 8
$drops['drops'] = round($drops['drops'], 8);
return $drops['drops'];
}

View File

@ -70,6 +70,10 @@ public function toDrops($amount = 1)
$total += $amount * $rate;
// amount 保留两位小数
$amount = round($amount, 2);
$lock = Cache::lock("lock_" . $cache_key, 5);
try {
$lock->block(5);