From 81a229793b3d0d1fa7cfce9adb2fc86202b63d30 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Wed, 18 Jan 2023 00:09:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=E4=BD=8D=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/User.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index c25a5c8..8830114 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -47,7 +47,7 @@ class User extends Authenticatable protected $casts = [ 'email_verified_at' => 'datetime', 'real_name_verified_at' => 'datetime', - 'balance' => 'decimal:2', + 'balance' => 'decimal:4', 'banned_at' => 'datetime', 'birthday_at' => 'date:Y-m-d' ]; @@ -191,7 +191,7 @@ public function reduce(string|null $amount = "0", string $description = "消费" } } - $this->balance = bcsub($this->balance, $amount, 2); + $this->balance = bcsub($this->balance, $amount, 4); $this->save(); $data = [ @@ -230,7 +230,7 @@ public function charge(string|null $amount = "0", string $payment = 'console', s Cache::lock('user_balance_' . $this->id, 10)->block(10, function () use ($amount, $description, $payment, $options) { $this->refresh(); - $this->balance = bcadd($this->balance, $amount, 2); + $this->balance = bcadd($this->balance, $amount, 4); $this->save(); $data = [