|
@@ -95,6 +95,8 @@ class DistAdminDistributorController extends AdminController
|
|
|
$show->field('dist_email',admin_trans_label('email'));
|
|
|
$show->field('dist_contact_number',admin_trans_label('contact_number'));
|
|
|
$show->field('country');
|
|
|
+ $show->field('country_alpha_2');
|
|
|
+ $show->field('country_lang');
|
|
|
$show->field('address');
|
|
|
// $show->field('domain_type')->using([0=>admin_trans_field('secondary_domain'),1=>admin_trans_field('custom_domain')]);
|
|
|
// $show->field('secondary_domain');
|
|
@@ -122,17 +124,13 @@ class DistAdminDistributorController extends AdminController
|
|
|
$form->select('country')
|
|
|
->options(BaseIso3166::selectOptions())
|
|
|
->width(9,3)->required();
|
|
|
+ $form->text('country_lang')->width(9,3)->required()->help('Please enter the language code, such as en ru es');
|
|
|
$form->text('address')->width(9,3);
|
|
|
-// $form->radio('domain_type')->width(9,3)
|
|
|
-// ->options([0=>admin_trans_field('secondary_domain'),1=>admin_trans_field('custom_domain')])
|
|
|
-// ->default(0)
|
|
|
-// ->required();
|
|
|
-// $form->text('secondary_domain')->width(9,3)
|
|
|
-// ->required()
|
|
|
-// ->help('Please enter the domain name, such as demo.'.env('TOP_DOMAIN'));
|
|
|
-// $form->text('custom_domain')->width(9,3)->help('Please enter the domain name, such as www.example.com');
|
|
|
$form->switch('enabled')->width(9,3)->default(1);
|
|
|
-
|
|
|
+ //保存前回调
|
|
|
+ $form->saving(function (Form $form) {
|
|
|
+ $form->country_alpha_2 = BaseIso3166::getAlpha2($form->country);
|
|
|
+ });
|
|
|
//保存后回调
|
|
|
$form->saved(function (Form $form, $result) {
|
|
|
if ($form->isCreating()) {
|