|
@@ -4,6 +4,7 @@ namespace App\Admin\Controllers;
|
|
|
|
|
|
use App\Admin\Repositories\DistAdminDistributor;
|
|
|
use App\Admin\Repositories\DistAppearance;
|
|
|
+use App\Models\DistProductCategory;
|
|
|
use Dcat\Admin\Form;
|
|
|
use Dcat\Admin\Grid;
|
|
|
use Dcat\Admin\Show;
|
|
@@ -37,10 +38,17 @@ class DistAdminDistributorController extends AdminController
|
|
|
$grid->column('id')->sortable();
|
|
|
$grid->column('company_name');
|
|
|
$grid->column('site_name');
|
|
|
- $grid->column('level_domain',);
|
|
|
+ $grid->column('domain_type',admin_trans_label('domain'))->display(function ($domainType) {
|
|
|
+ $title = "";
|
|
|
+ if ($domainType == 0) {
|
|
|
+ $title = $this->secondary_domain;
|
|
|
+ } else {
|
|
|
+ $title = $this->custom_domain;
|
|
|
+ }
|
|
|
+ return "<span style='color:#586cb1'>$title</span>";
|
|
|
+ });
|
|
|
+
|
|
|
$grid->column('country',);
|
|
|
- $grid->column('contact_number',);
|
|
|
- $grid->column('service_hotline',);
|
|
|
$grid->column('appearance.title' ,admin_trans_field('appearance'));
|
|
|
$grid->column('enabled')->switch();
|
|
|
$grid->column('created_at');
|
|
@@ -51,7 +59,7 @@ class DistAdminDistributorController extends AdminController
|
|
|
$filter->expand();
|
|
|
$filter->equal('company_name', )->width(2);
|
|
|
$filter->equal('site_name')->width(2);
|
|
|
- $filter->equal('level_domain')->width(2);
|
|
|
+ $filter->equal('domain')->width(2);
|
|
|
$filter->equal('enabled', )->select(config('dictionary.enabled'))->width(2);
|
|
|
});
|
|
|
// 排序
|
|
@@ -79,7 +87,15 @@ class DistAdminDistributorController extends AdminController
|
|
|
$show->field('company_name',);
|
|
|
$show->field('company_address');
|
|
|
$show->field('site_name');
|
|
|
- $show->field('level_domain');
|
|
|
+ $show->field('domain_type',admin_trans_label('domain'))->as(function ($domainType) {
|
|
|
+ $title = "";
|
|
|
+ if ($domainType == 0) {
|
|
|
+ $title = $this->secondary_domain;
|
|
|
+ } else {
|
|
|
+ $title = $this->custom_domain;
|
|
|
+ }
|
|
|
+ return "<span style='color:#586cb1'>$title</span>";
|
|
|
+ })->unescape();
|
|
|
$show->field('appearance.title' ,admin_trans_field('appearance'));
|
|
|
$show->field('country');
|
|
|
$show->field('contact_number');
|
|
@@ -111,7 +127,19 @@ class DistAdminDistributorController extends AdminController
|
|
|
$form->text('company_name', )->required();
|
|
|
$form->text('company_address',);
|
|
|
$form->text('site_name')->required();
|
|
|
- $form->text('level_domain')->required();
|
|
|
+
|
|
|
+ $form->radio('domain_type')
|
|
|
+ ->when(0, function (Form $form) {
|
|
|
+ $form->text('secondary_domain')->help('Please enter the domain name, such as demo.'.env('TOP_DOMAIN'));
|
|
|
+ })
|
|
|
+ ->when(1, function (Form $form) {
|
|
|
+ $form->text('custom_domain')->help('Please enter the domain name, such as www.example.com,and bind the domain name to the IP address '.env('DIST_SITE_IP'));
|
|
|
+ })
|
|
|
+ ->default(0)
|
|
|
+ ->options([0=>'second-level domain',1=>'custom domain'])
|
|
|
+ ->required();
|
|
|
+
|
|
|
+
|
|
|
$form->select('appearance_id',admin_trans_field('appearance'))->options(DistAppearance::selectOptions())->required();
|
|
|
$form->text('country')->required();
|
|
|
$form->text('contact_number');
|