试验性 更改
This commit is contained in:
parent
2cf12b01dc
commit
444d072dd9
@ -90,6 +90,8 @@ class Host extends Model
|
|||||||
protected $casts = [
|
protected $casts = [
|
||||||
// 'configuration' => 'array',
|
// 'configuration' => 'array',
|
||||||
'suspended_at' => 'datetime',
|
'suspended_at' => 'datetime',
|
||||||
|
'price' => 'decimal:2',
|
||||||
|
'managed_price' => 'decimal:2',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected static function boot()
|
protected static function boot()
|
||||||
@ -122,13 +124,13 @@ protected static function boot()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($model->isDirty('price')) {
|
// if ($model->isDirty('price')) {
|
||||||
$model->price = round($model->price, 2);
|
// $model->price = round($model->price, 2);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ($model->isDirty('managed_price') && $model->managed_price !== null) {
|
// if ($model->isDirty('managed_price') && $model->managed_price !== null) {
|
||||||
$model->managed_price = round($model->managed_price, 2);
|
// $model->managed_price = round($model->managed_price, 2);
|
||||||
}
|
// }
|
||||||
|
|
||||||
broadcast(new UserEvent($model->user_id, 'hosts.updating', $model));
|
broadcast(new UserEvent($model->user_id, 'hosts.updating', $model));
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user