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 @@ +table(['优惠券标题','使用优惠券消费总额(实付总金额)','订单总额(不包含配送费,含包装费)','配送费','优惠总金额','总订单数量'],$orderArray); $this->table(['ID','优惠券标题','满足金额','优惠金额','发放数量','已领取数量','使用数量'],$receiveArray); diff --git a/app/Models/CouponSetting.php b/app/Models/CouponSetting.php new file mode 100644 index 0000000..5e2cdcc --- /dev/null +++ b/app/Models/CouponSetting.php @@ -0,0 +1,16 @@ + [ + 'CouponSetting' => 'CouponSetting', + ], + 'fields' => [ + 'name' => '名称', + 'category' => '分类', + 'value' => '值', + 'desc' => '描述', + 'sort' => '排序', + 'status' => '状态', + ], + 'options' => [ + ], +];