|
@@ -74,8 +74,6 @@ class BaseProductController extends AdminController
|
|
|
return Show::make($id, BaseProduct::with(['baseProductCategory','images']), function (Show $show) {
|
|
|
$show->field('id');
|
|
|
$show->field('title');
|
|
|
- $show->field('keywords');
|
|
|
- $show->field('description');
|
|
|
$show->field('sku');
|
|
|
$show->field('base_product_category.name',admin_trans_label('category_name'));
|
|
|
$show->field('issuance_date');
|
|
@@ -106,6 +104,9 @@ class BaseProductController extends AdminController
|
|
|
$show->field('enabled')->using(config('dictionary.enabled'));
|
|
|
$show->field('created_at');
|
|
|
$show->field('updated_at');
|
|
|
+ $show->field('seo_title');
|
|
|
+ $show->field('seo_keywords');
|
|
|
+ $show->field('seo_description');
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -123,8 +124,6 @@ class BaseProductController extends AdminController
|
|
|
->options(BaseProductCategory::selectOptions())
|
|
|
->required();
|
|
|
$form->text('title')->required();
|
|
|
- $form->text('keywords');
|
|
|
- $form->textarea('description');
|
|
|
$form->text('sku')->required();
|
|
|
$form->date('issuance_date');
|
|
|
$form->table('parameters',admin_trans_label('parameter_name'), function (Form\NestedForm $table) {
|
|
@@ -152,8 +151,20 @@ class BaseProductController extends AdminController
|
|
|
$form->editor('content');
|
|
|
$form->switch('is_pinned')->default(0);
|
|
|
$form->switch('enabled')->default(1);
|
|
|
- //插入JS
|
|
|
+
|
|
|
+ $form->radio('visibility')->when(1,function (Form $form) {
|
|
|
+ $form->text('seo_title');
|
|
|
+ $form->text('seo_keywords');
|
|
|
+ $form->textarea('seo_description');
|
|
|
+ })->options(config('dictionary.visibility'))->default(1)->value(1);
|
|
|
+ //隐藏字段
|
|
|
+ $form->ignore(['visibility']);
|
|
|
+ //插入参数联动JS
|
|
|
$this->addParametersJs();
|
|
|
+ //新建时插入JS
|
|
|
+ $form->creating(function (Form $form) {
|
|
|
+ CommonHelper::seoReplace('title',false);
|
|
|
+ });
|
|
|
//保存前回调
|
|
|
$form->saving(function ($form) {
|
|
|
//检查sku是否重复
|