试验性 更改
This commit is contained in:
parent
5eb6f8b5cd
commit
2cf12b01dc
@ -23,6 +23,10 @@ class Transaction extends Model
|
||||
'paid_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'balance' => 'decimal:2',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
// 交易类型
|
||||
'type',
|
||||
|
@ -113,7 +113,7 @@ class User extends Authenticatable
|
||||
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
'balance' => 'float',
|
||||
'balance' => 'decimal:2',
|
||||
'banned_at' => 'datetime',
|
||||
];
|
||||
|
||||
@ -125,9 +125,9 @@ protected static function boot()
|
||||
|
||||
// balance 四舍五入
|
||||
|
||||
if ($model->isDirty('balance')) {
|
||||
$model->balance = round($model->balance, 2, PHP_ROUND_HALF_DOWN);
|
||||
}
|
||||
// if ($model->isDirty('balance')) {
|
||||
// $model->balance = round($model->balance, 2, PHP_ROUND_HALF_DOWN);
|
||||
// }
|
||||
|
||||
if ($model->isDirty('banned_at')) {
|
||||
if ($model->banned_at) {
|
||||
|
Loading…
Reference in New Issue
Block a user