修改部分功能
parent
dc08a1162d
commit
8a37aae51a
|
|
@ -111,6 +111,16 @@ class ArticleCategoryController extends AdminController
|
|||
$form->switch('is_recommend');
|
||||
$form->number('sort')->default(0);
|
||||
|
||||
$form->saving(function (Form $form) {
|
||||
if ($form->isEditing()) {
|
||||
if (!is_null($form->is_show) && (bool) $form->is_show !== $form->model()->is_show) {//如果改变显示隐藏
|
||||
//影响下级分类;
|
||||
$form->model()->descendants()->update(['is_show' => $form->is_show]);
|
||||
//影响上级分类;能力有限无法实现
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$form->display('created_at');
|
||||
$form->display('updated_at');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class ProductAttrController extends AdminController
|
|||
$filter->where('group', function ($query) {
|
||||
$query->whereIn('group_id', ProductAttrGroup::descendantsAndSelf($this->input, ['id'])->pluck('id'));
|
||||
}, __('product-attr.fields.group.name'))->select(ProductAttrGroup::selectOptions())->width(3);
|
||||
$filter->like('title')->width(3);
|
||||
$filter->like('name')->width(3);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
return [
|
||||
'labels' => [
|
||||
'ProductAttr' => '属性管理',
|
||||
'product-attr' => '属性管理',
|
||||
'product-attrs' => '属性管理',
|
||||
],
|
||||
'fields' => [
|
||||
'group' => [
|
||||
|
|
|
|||
Loading…
Reference in New Issue