bonus log add time field

This commit is contained in:
xiaomlove
2023-02-08 15:08:07 +08:00
parent cf4a9207d8
commit d96c603149
3 changed files with 8 additions and 1 deletions

View File

@@ -55,13 +55,15 @@ class BonusLogResource extends Resource
,
Tables\Columns\TextColumn::make('old_total_value')
->label(__('bonus-log.fields.old_total_value'))
->formatStateUsing(fn ($state) => number_format($state))
,
Tables\Columns\TextColumn::make('value')
->formatStateUsing(fn ($record) => $record->old_total_value > $record->new_total_value ? "-" . $record->value : "+" . $record->value)
->formatStateUsing(fn ($record) => $record->old_total_value > $record->new_total_value ? "-" . number_format($record->value) : "+" . number_format($record->value))
->label(__('bonus-log.fields.value'))
,
Tables\Columns\TextColumn::make('new_total_value')
->label(__('bonus-log.fields.new_total_value'))
->formatStateUsing(fn ($state) => number_format($state))
,
Tables\Columns\TextColumn::make('comment')
->label(__('label.comment'))