6
0
Fork 0

分销配置

release
李静 2021-12-29 21:10:28 +08:00
parent 2655a2eec0
commit eaa3bd791e
1 changed files with 67 additions and 6 deletions

View File

@ -39,17 +39,78 @@ class Distribution extends Form
// dd(config('distribution'), app_settings('distribution'));
$this->number('settle_days', '订单结算时间(天)')->value($appSettings['settle_days'] ?? 0)->help('订单完成后,隔多少天可以结算');
$this->currency('price_diff_fee_rate', '会员差价手续费')->value($appSettings['price_diff_fee_rate'] ?? 0)->symbol('%');
$this->currency('lvl_same_bonus_fee_rate', '平级奖励手续费')->value($appSettings['lvl_same_bonus_fee_rate'] ?? 0)->symbol('%');
$this->currency('lvl_diff_bonus_fee_rate', '级差奖励手续费')->value($appSettings['lvl_diff_bonus_fee_rate'] ?? 0)->symbol('%');
$this->text('settle_days', '订单结算时间(天)')
->value($appSettings['settle_days'] ?? 0)
->rules('required|numeric|min:0');
$this->text('price_diff_fee_rate', '会员差价手续费')
->prepend('%')
->value($appSettings['price_diff_fee_rate'] ?? 0)
->rules('required|int|min:0|max:100')
->saving(function ($value) {
return $value/100;
})
->customFormat(function ($value) {
return $value*100;
});
$this->text('lvl_same_bonus_fee_rate', '平级奖励手续费')
->prepend('%')
->value($appSettings['lvl_same_bonus_fee_rate'] ?? 0)
->rules('required|int|min:0|max:100')
->saving(function ($value) {
return $value/100;
})
->customFormat(function ($value) {
return $value*100;
});
$this->text('lvl_diff_bonus_fee_rate', '级差奖励手续费')
->prepend('%')
->value($appSettings['lvl_diff_bonus_fee_rate'] ?? 0)
->rules('required|int|min:0|max:100')
->saving(function ($value) {
return $value/100;
})
->customFormat(function ($value) {
return $value*100;
});
$this->text('quota_v2_rate', '获得配额比例')
->prepend('%')
->value($appSettings['quota_v2_rate'] ?? 0)
->rules('required|int|min:0|max:100')
->saving(function ($value) {
return $value/100;
})
->customFormat(function ($value) {
return $value*100;
});
// $this->divider();
$this->table('rules', '规则', function ($table) {
$table->hidden('lv_key');
$table->text('lv_name_show', '等级名称')->disable();
$table->hidden('lv_name');
$table->currency('lvl_same_bonus_rate', '平级奖励比例')->symbol('%');
$table->currency('lvl_diff_bonus_rate', '级差奖励比例')->symbol('%');
$table->text('lvl_same_bonus_rate', '平级奖励比例')
->prepend('%')
->rules('required|int|min:0|max:100')
->saving(function ($value) {
return $value/100;
})
->customFormat(function ($value) {
return $value*100;
});
$table->text('lvl_diff_bonus_rate', '级差奖励比例')
->prepend('%')
->rules('required|int|min:0|max:100')
->saving(function ($value) {
return $value/100;
})
->customFormat(function ($value) {
return $value*100;
});
})->customFormat(function ($v) use ($appSettings) {
$_rules = $appSettings['rules'] ?? [];
if ($_rules) {