|
@@ -17,13 +17,17 @@ use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
class DistAdminDistributorController extends AdminController
|
|
|
{
|
|
|
+ public function title()
|
|
|
+ {
|
|
|
+ return admin_trans( 'admin.distro_list');
|
|
|
+ }
|
|
|
/**
|
|
|
* page index
|
|
|
*/
|
|
|
public function index(Content $content)
|
|
|
{
|
|
|
return $content
|
|
|
- ->header(admin_trans( 'admin.distro_management'))
|
|
|
+ ->header($this->title())
|
|
|
->description('')
|
|
|
->breadcrumb(['text'=>'list','url'=>''])
|
|
|
->body($this->grid());
|
|
@@ -90,46 +94,10 @@ class DistAdminDistributorController extends AdminController
|
|
|
$show->field('dist_contact_number',admin_trans_label('contact_number'));
|
|
|
$show->field('secondary_domain');
|
|
|
$show->field('country');
|
|
|
+ $show->field('address');
|
|
|
$show->field('enabled')->using(admin_trans_array(config('dictionary.enabled')));
|
|
|
$show->field('created_at');
|
|
|
$show->field('updated_at');
|
|
|
- /*
|
|
|
- $show->field('company_name');
|
|
|
- $show->field('company_address');
|
|
|
- $show->field('site_name');
|
|
|
- $show->field('logo')->as(function ($image) {
|
|
|
- // 开始生成 HTML
|
|
|
- $dataImages = [$image];
|
|
|
- return CommonHelper::displayImage($dataImages,100);
|
|
|
- })->unescape();
|
|
|
- $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');
|
|
|
- $show->field('service_hotline');
|
|
|
- $show->field('whats_app');
|
|
|
- $show->field('facebook');
|
|
|
- $show->field('instagram');
|
|
|
- $show->field('youtube');
|
|
|
- $show->field('linkedin');
|
|
|
- $show->field('tiktok');
|
|
|
- $show->field('remark');
|
|
|
- $show->field('enabled')->using(admin_trans_array(config('dictionary.enabled')));
|
|
|
- $show->field('created_at');
|
|
|
- $show->field('updated_at');
|
|
|
- $show->field('copy_right');
|
|
|
- $show->field('seo_title');
|
|
|
- $show->field('seo_keywords');
|
|
|
- $show->field('seo_description');
|
|
|
- */
|
|
|
// 按钮
|
|
|
$show->disableDeleteButton();
|
|
|
|
|
@@ -151,86 +119,10 @@ class DistAdminDistributorController extends AdminController
|
|
|
->required()
|
|
|
->help('Please enter the domain name, such as demo.'.env('TOP_DOMAIN'));
|
|
|
$form->text('country')->width(9,3)->required();
|
|
|
+ $form->text('address')->width(9,3);
|
|
|
$form->switch('enabled')->width(9,3)->default(1);
|
|
|
- /*
|
|
|
- $form->text('company_name')->width(9,3)->required();
|
|
|
- $form->text('company_address',)->width(9,3);
|
|
|
- $form->text('site_name')->width(9,3)->required();
|
|
|
- $form->image("logo")
|
|
|
- ->autoUpload()
|
|
|
- ->uniqueName()
|
|
|
- ->accept(config('distributor.upload.oss_image.accept'))
|
|
|
- ->maxSize(config('distributor.upload.oss_image.max_size'))
|
|
|
- ->dir(config("distributor.upload.directory.image").'/logo')
|
|
|
- ->width(9,3);
|
|
|
- $form->radio('domain_type')
|
|
|
- ->width(9,3)
|
|
|
- ->when(0, function (Form $form) {
|
|
|
- $form->text('secondary_domain')->width(9,3)->help('Please enter the domain name, such as demo.'.env('TOP_DOMAIN'));
|
|
|
- })
|
|
|
- ->when(1, function (Form $form) {
|
|
|
- $form->text('custom_domain')->width(9,3)->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'))->width(9,3)->options(DistAppearance::selectOptions())->required();
|
|
|
- $form->text('country')->width(9,3)->required();
|
|
|
- $form->text('contact_number')->width(9,3);
|
|
|
- $form->text('service_hotline')->width(9,3);
|
|
|
- $form->text('whats_app')->width(9,3);
|
|
|
- $form->text('facebook')->width(9,3);
|
|
|
- $form->text('instagram')->width(9,3);
|
|
|
- $form->text('youtube')->width(9,3);
|
|
|
- $form->text('linkedin')->width(9,3);
|
|
|
- $form->text('tiktok')->width(9,3);
|
|
|
- $form->textarea('remark')->width(9,3);
|
|
|
- $form->switch('enabled')->width(9,3)->default(1);
|
|
|
- $form->text('copy_right')->width(9,3);
|
|
|
- $form->text('seo_title')->width(9,3)->required();
|
|
|
- $form->text('seo_keywords')->width(9,3);
|
|
|
- $form->textarea('seo_description')->width(9,3);
|
|
|
- */
|
|
|
-
|
|
|
- //保存前回调
|
|
|
-// $form->saving(function (Form $form) {
|
|
|
-// if (!$form->isCreating()) {
|
|
|
-// //如果appearance_id有变化,则更新模版与变量
|
|
|
-// if ($form->model()->appearance_id != $form->input('appearance_id')) {
|
|
|
-// $id = $form->model()->id;
|
|
|
-// //更新模版与变量
|
|
|
-// DistAppearance::switchTheme($form->input('appearance_id'), $id);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// });
|
|
|
- //保存后回调
|
|
|
-// $form->saved(function (Form $form, $result) {
|
|
|
-// if ($form->isCreating()) {
|
|
|
-// //创建后创建默认分类
|
|
|
-// $newId = $form->getKey();
|
|
|
-// $appearanceId = $form->input('appearance_id');
|
|
|
-// //初始化分销商
|
|
|
-// DistAdminDistributor::initDist($appearanceId,$newId);
|
|
|
-// //更新模版与变量
|
|
|
-// DistAppearance::switchTheme($appearanceId, $newId);
|
|
|
-// }
|
|
|
-// });
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- * 新增事件事务
|
|
|
- */
|
|
|
-// public function store()
|
|
|
-// {
|
|
|
-// try {
|
|
|
-// DB::beginTransaction();
|
|
|
-// $result = parent::store();
|
|
|
-// DB::commit();
|
|
|
-// return $result;
|
|
|
-// } catch (\Exception $e) {
|
|
|
-// DB::rollBack();
|
|
|
-// throw $e;
|
|
|
-// }
|
|
|
-// }
|
|
|
+
|
|
|
}
|