From 66096cc393e133a8c7986053b240fcb595ae4499 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 17 Aug 2020 10:20:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=98=E6=83=A0=E5=88=B8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/CouponSettingController.php | 80 +++++++++++++++++++ app/Admin/Repositories/CouponSetting.php | 16 ++++ app/Models/CouponSetting.php | 16 ++++ resources/lang/zh-CN/coupon-setting.php | 16 ++++ 4 files changed, 128 insertions(+) create mode 100644 app/Admin/Controllers/CouponSettingController.php create mode 100644 app/Admin/Repositories/CouponSetting.php create mode 100644 app/Models/CouponSetting.php create mode 100644 resources/lang/zh-CN/coupon-setting.php diff --git a/app/Admin/Controllers/CouponSettingController.php b/app/Admin/Controllers/CouponSettingController.php new file mode 100644 index 0000000..6e03881 --- /dev/null +++ b/app/Admin/Controllers/CouponSettingController.php @@ -0,0 +1,80 @@ +id->sortable(); + $grid->name; + $grid->category; + $grid->value; + $grid->desc; + $grid->sort; + $grid->status; + $grid->created_at; + $grid->updated_at->sortable(); + + $grid->filter(function (Grid\Filter $filter) { + $filter->equal('id'); + + }); + }); + } + + /** + * Make a show builder. + * + * @param mixed $id + * + * @return Show + */ + protected function detail($id) + { + return Show::make($id, new CouponSetting(), function (Show $show) { + $show->id; + $show->name; + $show->category; + $show->value; + $show->desc; + $show->sort; + $show->status; + $show->created_at; + $show->updated_at; + }); + } + + /** + * Make a form builder. + * + * @return Form + */ + protected function form() + { + return Form::make(new CouponSetting(), function (Form $form) { + $form->display('id'); + $form->text('name'); + $form->text('category'); + $form->text('value'); + $form->text('desc'); + $form->text('sort'); + $form->text('status'); + + $form->display('created_at'); + $form->display('updated_at'); + }); + } +} diff --git a/app/Admin/Repositories/CouponSetting.php b/app/Admin/Repositories/CouponSetting.php new file mode 100644 index 0000000..2270a10 --- /dev/null +++ b/app/Admin/Repositories/CouponSetting.php @@ -0,0 +1,16 @@ + [ + 'CouponSetting' => 'CouponSetting', + ], + 'fields' => [ + 'name' => '名称', + 'category' => '分类', + 'value' => '值', + 'desc' => '描述', + 'sort' => '排序', + 'status' => '状态', + ], + 'options' => [ + ], +];