From 444d072dd949690d0ca0f95774d1028629eecfee Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Wed, 30 Nov 2022 20:27:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E9=AA=8C=E6=80=A7=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Host.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Models/Host.php b/app/Models/Host.php index 7704d73..3caea57 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -90,6 +90,8 @@ class Host extends Model protected $casts = [ // 'configuration' => 'array', 'suspended_at' => 'datetime', + 'price' => 'decimal:2', + 'managed_price' => 'decimal:2', ]; protected static function boot() @@ -122,13 +124,13 @@ protected static function boot() } } - if ($model->isDirty('price')) { - $model->price = round($model->price, 2); - } + // if ($model->isDirty('price')) { + // $model->price = round($model->price, 2); + // } - if ($model->isDirty('managed_price') && $model->managed_price !== null) { - $model->managed_price = round($model->managed_price, 2); - } + // if ($model->isDirty('managed_price') && $model->managed_price !== null) { + // $model->managed_price = round($model->managed_price, 2); + // } broadcast(new UserEvent($model->user_id, 'hosts.updating', $model)); });