保留 8 位
This commit is contained in:
parent
6c152a2d43
commit
dae507198d
@ -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;
|
||||
|
||||
|
@ -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'];
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user