mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:48:51 +08:00
add medal bonus addition
This commit is contained in:
@@ -70,6 +70,12 @@ class MedalResource extends Resource
|
||||
->label(__('medal.fields.sale_end_time'))
|
||||
->helperText(__('medal.fields.sale_end_time_help'))
|
||||
,
|
||||
Forms\Components\TextInput::make('bonus_addition_factor')
|
||||
->label(__('medal.fields.bonus_addition_factor'))
|
||||
->helperText(__('medal.fields.bonus_addition_factor_help'))
|
||||
->numeric()
|
||||
->default(0)
|
||||
,
|
||||
Forms\Components\Textarea::make('description')
|
||||
->label(__('label.description'))
|
||||
,
|
||||
@@ -89,6 +95,7 @@ class MedalResource extends Resource
|
||||
->label(__('medal.fields.sale_begin_end_time'))
|
||||
->formatStateUsing(fn ($record) => new HtmlString(sprintf('%s ~<br/>%s', $record->sale_begin_time ?? '--', $record->sale_end_time ?? '--')))
|
||||
,
|
||||
Tables\Columns\TextColumn::make('bonus_addition_factor')->label(__('medal.fields.bonus_addition_factor')),
|
||||
Tables\Columns\TextColumn::make('price')->label(__('label.price')),
|
||||
|
||||
Tables\Columns\TextColumn::make('duration')->label(__('label.medal.duration')),
|
||||
|
||||
@@ -91,6 +91,11 @@ class CalculateUserSeedBonus implements ShouldQueue
|
||||
$all_bonus += $haremAddition;
|
||||
$bonusLog .= ", haremAdditionFactor: $haremAdditionFactor, haremBonus: $haremBonus, haremAddition: $haremAddition, all_bonus: $all_bonus";
|
||||
}
|
||||
if ($seedBonusResult['medal_additional_factor'] > 0) {
|
||||
$medalAddition = $seedBonusResult['medal_bonus'] * $seedBonusResult['medal_additional_factor'];
|
||||
$all_bonus += $medalAddition;
|
||||
$bonusLog .= ", medalAdditionFactor: {$seedBonusResult['medal_additional_factor']}, medalBonus: {$seedBonusResult['medal_bonus']}, medalAddition: $medalAddition, all_bonus: $all_bonus";
|
||||
}
|
||||
$dividend = 3600 / $autoclean_interval_one;
|
||||
$all_bonus = $all_bonus / $dividend;
|
||||
$seed_points = $seedBonusResult['seed_points'] / $dividend;
|
||||
|
||||
@@ -17,7 +17,7 @@ class Medal extends NexusModel
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'description', 'image_large', 'image_small', 'price', 'duration', 'get_type',
|
||||
'display_on_medal_page', 'sale_begin_time', 'sale_end_time', 'inventory',
|
||||
'display_on_medal_page', 'sale_begin_time', 'sale_end_time', 'inventory', 'bonus_addition_factor',
|
||||
];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
Reference in New Issue
Block a user