6
0
Fork 0

添加后台配置规则

release
vine_liutk 2022-01-18 11:00:33 +08:00 committed by 李静
parent 1e97a5b269
commit 969a279444
1 changed files with 44 additions and 0 deletions

View File

@ -19,6 +19,7 @@ class Dealer extends Form
*/
public function handle(array $input)
{
// dd($input);
Setting::where('key', 'dealer')->updateOrCreate([
'key' => 'dealer',
], ['value' => $input]);
@ -41,7 +42,49 @@ class Dealer extends Form
$this->currency('upgrade_amount_'.DealerLvl::Contracted->value, '签约门槛')->symbol('¥');
$this->currency('upgrade_amount_'.DealerLvl::Special->value, '特邀门槛')->symbol('¥');
$this->currency('upgrade_amount_'.DealerLvl::Gold->value, '金牌门槛')->symbol('¥');
$this->number('order_auto_allocate_times', '订单自动分配时间(小时)')->min(1);
$this->divider('签约->签约->签约');
$this->currency('channel_rules.'.DealerLvl::Contracted->value.'_'.DealerLvl::Contracted->value.'.'.DealerLvl::Contracted->value.'_0', '签约0')->symbol('¥');
$this->currency('channel_rules.'.DealerLvl::Contracted->value.'_'.DealerLvl::Contracted->value.'.'.DealerLvl::Contracted->value.'_1', '签约1')->symbol('¥');
$this->divider('签约->特邀->签约->签约');
$this->currency('channel_rules.'.DealerLvl::Contracted->value.'_'.DealerLvl::Special->value.'.'.DealerLvl::Special->value.'_0', '特邀0')->symbol('¥');
$this->currency('channel_rules.'.DealerLvl::Contracted->value.'_'.DealerLvl::Special->value.'.'.DealerLvl::Contracted->value.'_1', '签约1')->symbol('¥');
$this->currency('channel_rules.'.DealerLvl::Contracted->value.'_'.DealerLvl::Special->value.'.'.DealerLvl::Contracted->value.'_2', '签约2')->symbol('¥');
$this->divider('特邀->特邀->特邀');
$this->currency('channel_rules.'.DealerLvl::Special->value.'_'.DealerLvl::Special->value.'.'.DealerLvl::Special->value.'_0', '特邀0')->symbol('¥');
$this->currency('channel_rules.'.DealerLvl::Special->value.'_'.DealerLvl::Special->value.'.'.DealerLvl::Special->value.'_1', '特邀1')->symbol('¥');
$this->divider('特邀->金牌->特邀->特邀');
$this->currency('channel_rules.'.DealerLvl::Special->value.'_'.DealerLvl::Gold->value.'.'.DealerLvl::Gold->value.'_0', '金牌0')->symbol('¥');
$this->currency('channel_rules.'.DealerLvl::Special->value.'_'.DealerLvl::Gold->value.'.'.DealerLvl::Special->value.'_1', '特邀1')->symbol('¥');
$this->currency('channel_rules.'.DealerLvl::Special->value.'_'.DealerLvl::Gold->value.'.'.DealerLvl::Special->value.'_2', '特邀2')->symbol('¥');
$this->divider('金牌->金牌');
$this->currency('channel_rules.'.DealerLvl::Gold->value.'_'.DealerLvl::Gold->value.'.'.DealerLvl::Gold->value.'_0', '金牌0')->symbol('¥');
// $this->embeds('channel_rules.'.DealerLvl::Contracted->value.'_'.DealerLvl::Contracted->value, '渠道补贴规则(签约->签约->签约)', function ($form) {
// $form->currency(DealerLvl::Contracted->value.'_0', '签约0')->symbol('¥');
// $form->currency(DealerLvl::Contracted->value.'_1', '签约1')->symbol('¥');
// });
// $this->embeds('channel_rules.'.DealerLvl::Contracted->value.'_'.DealerLvl::Special->value, '渠道补贴规则(签约->特邀->签约->签约)', function ($form) {
// $form->currency(DealerLvl::Special->value.'_0', '特邀0')->symbol('¥');
// $form->currency(DealerLvl::Contracted->value.'_1', '签约1')->symbol('¥');
// $form->currency(DealerLvl::Contracted->value.'_2', '签约2')->symbol('¥');
// });
// $this->embeds('channel_rules.'.DealerLvl::Special->value.'_'.DealerLvl::Special->value, '渠道补贴规则(特邀->特邀->特邀)', function ($form) {
// $form->currency(DealerLvl::Special->value.'_0', '特邀0')->symbol('¥');
// $form->currency(DealerLvl::Special->value.'_1', '特邀1')->symbol('¥');
// });
// $this->embeds('channel_rules.'.DealerLvl::Special->value.'_'.DealerLvl::Gold->value, '渠道补贴规则(特邀->金牌->特邀->特邀)', function ($form) {
// $form->currency(DealerLvl::Gold->value.'_0', '金牌0')->symbol('¥');
// $form->currency(DealerLvl::Special->value.'_1', '特邀1')->symbol('¥');
// $form->currency(DealerLvl::Special->value.'_2', '特邀2')->symbol('¥');
// });
// $this->embeds('channel_rules.'.DealerLvl::Gold->value.'_'.DealerLvl::Gold->value, '渠道补贴规则(金牌->金牌)', function ($form) {
// $form->currency(DealerLvl::Gold->value.'_0', '金牌0')->symbol('¥');
// });
$this->table('purchase_rules', '进货补贴规则', function ($table) {
$table->number('price', '阶梯(万)');
$table->currency('rate', '比例(百分比)')->symbol('%');
@ -93,6 +136,7 @@ class Dealer extends Form
'alipay'=>$dealerSettings['alipay'] ?? [],
'wechat' =>$dealerSettings['wechat'] ?? [],
'purchase_rules'=>$dealerSettings['purchase_rules'] ?? [],
'channel_rules'=>$dealerSettings['channel_rules'] ?? [],
];
}
}