diff --git a/app/Admin/Controllers/CouponController.php b/app/Admin/Controllers/CouponController.php new file mode 100644 index 00000000..0bea57bb --- /dev/null +++ b/app/Admin/Controllers/CouponController.php @@ -0,0 +1,152 @@ +column('id')->sortable(); + $grid->column('name'); + $grid->column('type')->using([ + 1 =>'抵扣券', + 2 =>'折扣券', + ])->label(); + $grid->column('value')->display(function ($value) { + if ($this->type == 1) { + return $value.'元'; + } elseif ($this->type == 2) { + return $value.'折'; + } + })->label(); + $grid->column('threshold')->append('元'); + $grid->column('limit'); + $grid->column('sent'); + $grid->column('use_day')->append('天'); + $grid->column('use_start_at'); + $grid->column('use_end_at'); + $grid->column('created_at')->sortable(); + + /** 操作 **/ + //新增 + if (Admin::user()->can('dcat.admin.coupons.create')) { + $grid->disableCreateButton(false); + $grid->enableDialogCreate(); + $grid->setDialogFormDimensions('40%', '70%'); + } + //修改 + $grid->showQuickEditButton(Admin::user()->can('dcat.admin.coupons.edit')); + //删除以及自定义操作 + $grid->actions(function (Grid\Displayers\Actions $actions) { + $actions->disableDelete(Admin::user()->cannot('dcat.admin.coupons.destroy')); + if (Admin::user()->can('dcat.admin.coupons.range_list')) { + $actions->append(' 使用范围'); + } + }); + + /** 查询 **/ + $grid->filter(function (Grid\Filter $filter) { + $filter->panel(); + $filter->liek('name')->width(3); + }); + }); + } + + /** + * Make a show builder. + * + * @param mixed $id + * + * @return Show + */ + protected function detail($id) + { + return Show::make($id, new Coupon(), function (Show $show) { + $show->field('id'); + $show->field('name'); + $show->field('type'); + $show->field('value'); + $show->field('threshold'); + $show->field('limit'); + $show->field('sent'); + $show->field('use_day'); + $show->field('use_start_at'); + $show->field('use_end_at'); + $show->field('created_at'); + $show->field('updated_at'); + }); + } + + /** + * Make a form builder. + * + * @return Form + */ + protected function form() + { + return Form::make(new Coupon(), function (Form $form) { + $form->display('id'); + $form->text('name')->required(); + $form->radio('type') + ->when(1, function (Form $form) { + $form->currency('value1')->symbol('¥')->help('例:100.00表示优惠100元。')->value($form->model()->value); + }) + ->when(2, function (Form $form) { + $form->currency('value2')->symbol('%')->help('例:0.95表示95折。')->value($form->model()->value); + }) + ->options([ + 1 =>'抵扣券', + 2 =>'折扣券', + ])->default(1); + + $form->currency('threshold')->symbol('¥')->default(0); + $form->number('limit')->default(0); + $form->number('use_day')->default(0)->help('单位:天;指领取后几天内有效。'); + $form->datetimeRange('use_start_at', 'use_end_at', '使用时间')->help('设置时间后,期限字段失效。'); + $form->hidden('value'); + + $form->saving(function (Form $form) { + $value = 'value'.$form->type; + $form->value = $form->$value; + + $form->deleteInput('value1'); + $form->deleteInput('value2'); + }); + + $form->display('created_at'); + $form->display('updated_at'); + }); + } + + /** + * 使用范围列表 + * + * @param Content $content + * @param CouponModel $coupon + * @return void + */ + public function rangeList(Content $content, CouponModel $coupon) + { + $builder = CouponRange::where('coupon_id', $coupon->id); + return $content->header(__('coupon.labels.coupons')) + ->description($coupon->name) + ->body(CouponRangeTable::grid($coupon->id)); + } +} diff --git a/app/Admin/Controllers/CouponRangeController.php b/app/Admin/Controllers/CouponRangeController.php new file mode 100644 index 00000000..3f8531ff --- /dev/null +++ b/app/Admin/Controllers/CouponRangeController.php @@ -0,0 +1,111 @@ +field('id'); + $show->field('coupon_id'); + $show->field('type'); + $show->field('ranges'); + $show->field('created_at'); + $show->field('updated_at'); + }); + } + + /** + * Make a form builder. + * + * @return Form + */ + protected function form() + { + return Form::make(new CouponRange(), function (Form $form) { + $couponId = Request::get('coupon_id', 0); + $form->display('id'); + if ($couponId) { + $form->select('coupon_id_show', __('coupon-range.fields.coupon_id'))->options(Coupon::all()->pluck('name', 'id'))->value($couponId)->disable(); + $form->hidden('coupon_id')->value($couponId); + } else { + $form->select('coupon_id')->options(Coupon::all()->pluck('name', 'id'))->required(); + } + + $form->radio('type') + ->when(1, function (Form $form) { + $form->tree('ranges1') + ->nodes(ProductCategory::get()->toArray()) // 设置所有节点 + ->setTitleColumn('name') + ->customFormat(function ($v) { + if ($this->model()->type == 1) { + $v = $this->model()->ranges; + } else { + $v = []; + } + return $v; + })->expand(false); + }) + ->when(2, function (Form $form) { + $form->multipleSelectTable('ranges2') + ->from(ProductSkuSimpleTable::make()) + ->model(ProductSku::class, 'id', 'name') + ->customFormat(function ($v) { + if ($this->model()->type == 2) { + $v = $this->model()->ranges; + } else { + $v = []; + } + return $v; + }); + }) + ->options([ + 1=>'商品分类', + 2=>'SKU商品', + ])->default(1); + $form->hidden('ranges'); + $form->ignore(['coupon_id_show']); + + $form->saving(function (Form $form) { + $ranges = 'ranges'.$form->type; + $form->ranges = $form->$ranges; + + $form->deleteInput('ranges1'); + $form->deleteInput('ranges2'); + }); + + $form->display('created_at'); + $form->display('updated_at'); + }); + } +} diff --git a/app/Admin/Controllers/ProductCategoryController.php b/app/Admin/Controllers/ProductCategoryController.php index d5759273..7afee7fd 100644 --- a/app/Admin/Controllers/ProductCategoryController.php +++ b/app/Admin/Controllers/ProductCategoryController.php @@ -115,6 +115,15 @@ class ProductCategoryController extends AdminController $form->switch('is_show'); $form->switch('is_recommend'); $form->number('sort')->default(0); + $form->saving(function (Form $form) { + //只能添加到三级分类 + if ($form->parent_id) { + $result = ProductCategoryModel::withDepth()->find($form->parent_id); + if ($result->depth >= 2) { + return $form->response()->error('不能创建四级以及以下的分类'); + } + } + }); $form->display('created_at'); $form->display('updated_at'); @@ -123,7 +132,7 @@ class ProductCategoryController extends AdminController public function destroy($id) { - //如果有子分类或者分类下有文章则不允许删除 + //如果有子分类或者分类下有商品则不允许删除 if (ProductCategoryModel::descendantsOf($id, ['id'])->count() > 0 || ProductSpu::where('category_id', $id)->count() > 0) { throw new BizException(__('product-category.options.deny_message')); diff --git a/app/Admin/Controllers/ProductSkuController.php b/app/Admin/Controllers/ProductSkuController.php index 1bcd7207..4d2d73ed 100644 --- a/app/Admin/Controllers/ProductSkuController.php +++ b/app/Admin/Controllers/ProductSkuController.php @@ -117,7 +117,7 @@ class ProductSkuController extends AdminController public function destroy($id) { $sku = ProductSkuModel::findOrFail($id); - if ($sku->release_at || $sku->verify_state == 1) {//如果是上架中、或者审核中的,无法删除 + if ($sku->release_at || $sku->verify_state == 1 || $sku->sales > 0) {//如果是上架中、审核中或者已售出的,无法删除 throw new BizException(__('product-sku.options.deny_message')); } return parent::destroy($id); diff --git a/app/Admin/Controllers/ProductSpuController.php b/app/Admin/Controllers/ProductSpuController.php index a2a7cb22..8ae36e26 100644 --- a/app/Admin/Controllers/ProductSpuController.php +++ b/app/Admin/Controllers/ProductSpuController.php @@ -174,7 +174,7 @@ class ProductSpuController extends AdminController * * @return void */ - public function list(Content $content, ProductSpuModel $spu) + public function skuList(Content $content, ProductSpuModel $spu) { return $content->header(__('product-spu.labels.ProductSpu')) ->description($spu->name) diff --git a/app/Admin/Renderable/CouponRangeSkuTable.php b/app/Admin/Renderable/CouponRangeSkuTable.php new file mode 100644 index 00000000..1748d9d1 --- /dev/null +++ b/app/Admin/Renderable/CouponRangeSkuTable.php @@ -0,0 +1,26 @@ +payload['id']; + // dd($partId); + $couponRange = CouponRange::findOrFail($rangeId); + $builder = ProductSku::whereIn('id', explode(',', $couponRange->ranges)); + + return Grid::make($builder, function (Grid $grid) { + $grid->column('name', __('product-sku.fields.name')); + $grid->column('specs', __('product-sku.fields.specs'))->label(); + $grid->quickSearch(['name']); + $grid->disableActions(); + }); + } +} diff --git a/app/Admin/Renderable/CouponRangeTable.php b/app/Admin/Renderable/CouponRangeTable.php new file mode 100644 index 00000000..90dca8fd --- /dev/null +++ b/app/Admin/Renderable/CouponRangeTable.php @@ -0,0 +1,68 @@ +setResource('coupon-ranges'); + $grid->column('id')->sortable(); + $grid->column('coupon.name'); + $grid->column('type')->using([ + 1=>'商品分类', + 2=>'SKU商品', + ])->label(); + $grid->column('ranges') + ->if(function () { + return $this->type == 1; + })->then(function (Column $column) { + $column->showTreeInDialog(function (Grid\Displayers\DialogTree $tree) { + $tree->nodes(ProductCategory::get()->toArray()); + $tree->setTitleColumn('name'); + }); + }) + ->else(function (Column $column) { + $column->display('查看')->modal(function ($modal) { + $modal->icon('feather icon-align-right'); + $modal->title('SKU商品'); + return CouponRangeSkuTable::make(['id'=>$this->id]); + }); + }); + $grid->column('created_at'); + $grid->column('updated_at')->sortable(); + + /** 操作 **/ + //新增 + if (Admin::user()->can('dcat.admin.coupon_ranges.create')) { + $grid->disableCreateButton(false); + $grid->enableDialogCreate(); + } + //修改 + $grid->showQuickEditButton(Admin::user()->can('dcat.admin.coupon_ranges.edit')); + //删除以及自定义操作 + $grid->actions(function (Grid\Displayers\Actions $actions) { + $actions->disableView(); + $actions->disableEdit(); + $actions->disableDelete(Admin::user()->cannot('dcat.admin.coupon_ranges.destroy')); + }); + }); + + if ($couponId) { + $grid->model()->where('coupon_id', $couponId); + $grid->model()->setConstraints([ + 'coupon_id' => $couponId, + ]); + } + return $grid; + } +} diff --git a/app/Admin/Renderable/ProductSkuSimpleTable.php b/app/Admin/Renderable/ProductSkuSimpleTable.php index b4194a03..c6cddd19 100644 --- a/app/Admin/Renderable/ProductSkuSimpleTable.php +++ b/app/Admin/Renderable/ProductSkuSimpleTable.php @@ -10,14 +10,11 @@ class ProductSkuSimpleTable extends LazyRenderable { public function grid(): Grid { - $partId = $this->part_id; $builder = ProductSku::query(); - // $builder->with('parts')->whereHas('parts', function ($query) use ($partId) { - // $query->where('id', $partId); - // }); return Grid::make($builder, function (Grid $grid) { $grid->disableRowSelector(false); $grid->column('name'); + $grid->column('specs')->label(); $grid->quickSearch(['name']); $grid->disableActions(); }); diff --git a/app/Admin/Renderable/ProductSkuTable.php b/app/Admin/Renderable/ProductSkuTable.php index d4b02550..ed6f2dd5 100644 --- a/app/Admin/Renderable/ProductSkuTable.php +++ b/app/Admin/Renderable/ProductSkuTable.php @@ -65,6 +65,7 @@ class ProductSkuTable extends Grid $grid->model()->orderBy('created_at', 'desc'); $grid->model()->orderBy('release_at', 'desc'); $grid->actions(function (Grid\Displayers\Actions $actions) { + $actions->disableView(); if (is_null($actions->row->release_at) || $actions->row->verify_state == 1) {//未上架或者审核未通过 $actions->disableEdit(Admin::user()->cannot('dcat.admin.product_skus.edit')); $actions->disableDelete(Admin::user()->cannot('dcat.admin.product_skus.destroy')); diff --git a/app/Admin/Repositories/Coupon.php b/app/Admin/Repositories/Coupon.php new file mode 100644 index 00000000..db42d1fb --- /dev/null +++ b/app/Admin/Repositories/Coupon.php @@ -0,0 +1,16 @@ +names('product_buynotes'); $router->resource('product-spus', 'ProductSpuController')->names('product_spus'); - $router->get('product-spus/{spu}/list', 'ProductSpuController@list')->name('product_spus.list'); + $router->get('product-spus/{spu}/sku-list', 'ProductSpuController@skuList')->name('product_spus.sku_list'); $router->resource('product-skus', 'ProductSkuController')->only([ 'index', 'edit', 'update', 'destroy', ])->names('product_skus'); + $router->resource('coupons', 'CouponController')->names('coupons'); + $router->get('coupons/{coupon}/range-list', 'CouponController@rangeList')->name('coupons.range_list'); + $router->resource('coupon-ranges', 'CouponRangeController')->only([ + 'create', 'store', 'edit', 'update', 'destroy', + ])->names('coupon_ranges'); + $router->resource('product-sku-verifies', 'ProductSkuVerifyController')->only([ 'index', 'edit', 'update', 'destroy', ])->names('product_sku_verifies'); diff --git a/app/Models/Coupon.php b/app/Models/Coupon.php new file mode 100644 index 00000000..8b1d11b2 --- /dev/null +++ b/app/Models/Coupon.php @@ -0,0 +1,29 @@ + Price::class, + 'threshold'=>Price::class, + ]; + + /** + * 此优惠券的使用范围 + * + * @return void + */ + public function ranges() + { + return $this->hasMany(CouponRange::class, 'coupon_id'); + } +} diff --git a/app/Models/CouponRange.php b/app/Models/CouponRange.php new file mode 100644 index 00000000..642ba26b --- /dev/null +++ b/app/Models/CouponRange.php @@ -0,0 +1,18 @@ +belongsTo(Coupon::class, 'coupon_id'); + } +} diff --git a/app/Models/UserCoupon.php b/app/Models/UserCoupon.php new file mode 100644 index 00000000..57f21be1 --- /dev/null +++ b/app/Models/UserCoupon.php @@ -0,0 +1,11 @@ +id(); + $table->string('name')->comment('优惠券名称'); + $table->text('description')->nullable()->comment('优惠券说明'); + $table->tinyInteger('type')->default(0)->unsigned()->comment('优惠券类型:1抵扣券,2折扣券'); + $table->unsignedInteger('value')->default(0)->comment('抵扣金额:分/折扣(100)'); + $table->unsignedBigInteger('threshold')->default(0)->comment('使用门槛金额:分'); + $table->unsignedInteger('limit')->default(0)->comment('限量'); + $table->unsignedInteger('sent')->default(0)->comment('已送数量'); + $table->unsignedInteger('use_day')->default(0)->comment('使用期限'); + $table->timestamp('use_start_at')->nullable()->comment('使用开始时间'); + $table->timestamp('use_end_at')->nullable()->comment('使用结束时间'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('coupons'); + } +} diff --git a/database/migrations/2021_12_07_111745_create_coupon_ranges_table.php b/database/migrations/2021_12_07_111745_create_coupon_ranges_table.php new file mode 100644 index 00000000..ab0a3486 --- /dev/null +++ b/database/migrations/2021_12_07_111745_create_coupon_ranges_table.php @@ -0,0 +1,35 @@ +id(); + $table->unsignedBigInteger('coupon_id')->comment('优惠券ID'); + $table->unsignedTinyInteger('type')->default(0)->comment('类型:1商品分类,2sku商品'); + $table->text('ranges')->comment('范围IDS'); + $table->unsignedTinyInteger('status')->default(0)->comment('0未启用,1启用'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('coupon_ranges'); + } +} diff --git a/database/migrations/2021_12_07_115801_create_user_coupons_table.php b/database/migrations/2021_12_07_115801_create_user_coupons_table.php new file mode 100644 index 00000000..ed97c8ae --- /dev/null +++ b/database/migrations/2021_12_07_115801_create_user_coupons_table.php @@ -0,0 +1,42 @@ +id(); + $table->unsignedBigInteger('user_id')->comment('用户ID'); + $table->unsignedBigInteger('coupon_id')->comment('优惠ID'); + $table->string('coupon_name')->comment('优惠券名称'); + $table->tinyInteger('coupon_type')->default(0)->unsigned()->comment('优惠券类型:1抵扣券,2折扣券'); + $table->unsignedInteger('coupon_value')->default(0)->comment('抵扣金额:分/折扣(100)'); + $table->unsignedBigInteger('coupon_threshold')->default(0)->comment('使用门槛金额:分'); + $table->timestamp('use_start_at')->comment('使用开始时间'); + $table->timestamp('use_end_at')->comment('使用结束时间'); + $table->unsignedTinyInteger('status')->default(0)->comment('状态:0未使用,1已使用'); + $table->timestamps(); + + $table->index('user_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('user_coupons'); + } +} diff --git a/database/seeders/AdminPermissionSeeder.php b/database/seeders/AdminPermissionSeeder.php index c30ca961..555fc838 100644 --- a/database/seeders/AdminPermissionSeeder.php +++ b/database/seeders/AdminPermissionSeeder.php @@ -95,7 +95,7 @@ class AdminPermissionSeeder extends Seeder 'name' =>'主商品', 'curd'=> true, 'children'=>[ - 'list'=>['name'=>'子商品列表'], + 'sku_list'=>['name'=>'子商品列表'], 'setting_specs'=>['name'=>'设置规格'], 'init_sku_by_specs'=>['name' =>'初始化SKU'], 'add_sku'=>['name' =>'添加子商品'], @@ -132,6 +132,17 @@ class AdminPermissionSeeder extends Seeder 'enable'=>['name' =>'启用'], ], ], + 'coupons'=>[ + 'name' =>'优惠券管理', + 'curd' => true, + 'children'=>[ + 'range_list' =>'使用范围', + ], + ], + 'coupon_ranges'=>[ + 'name' =>'优惠使用范围管理', + 'curd' => ['create', 'store', 'edit', 'update', 'destroy'], + ], ]; try { DB::begintransaction(); diff --git a/dcat_admin_ide_helper.php b/dcat_admin_ide_helper.php index 00c560a8..167b061b 100644 --- a/dcat_admin_ide_helper.php +++ b/dcat_admin_ide_helper.php @@ -59,6 +59,14 @@ namespace Dcat\Admin { * @property Grid\Column|Collection subtitle * @property Grid\Column|Collection cover * @property Grid\Column|Collection content + * @property Grid\Column|Collection coupon_id + * @property Grid\Column|Collection ranges + * @property Grid\Column|Collection threshold + * @property Grid\Column|Collection limit + * @property Grid\Column|Collection sent + * @property Grid\Column|Collection use_day + * @property Grid\Column|Collection use_start_at + * @property Grid\Column|Collection use_end_at * @property Grid\Column|Collection uuid * @property Grid\Column|Collection connection * @property Grid\Column|Collection queue @@ -74,7 +82,6 @@ namespace Dcat\Admin { * @property Grid\Column|Collection sku_id * @property Grid\Column|Collection gift_sku_id * @property Grid\Column|Collection num - * @property Grid\Column|Collection sent * @property Grid\Column|Collection attrs * @property Grid\Column|Collection specs * @property Grid\Column|Collection part_id @@ -162,6 +169,14 @@ namespace Dcat\Admin { * @method Grid\Column|Collection subtitle(string $label = null) * @method Grid\Column|Collection cover(string $label = null) * @method Grid\Column|Collection content(string $label = null) + * @method Grid\Column|Collection coupon_id(string $label = null) + * @method Grid\Column|Collection ranges(string $label = null) + * @method Grid\Column|Collection threshold(string $label = null) + * @method Grid\Column|Collection limit(string $label = null) + * @method Grid\Column|Collection sent(string $label = null) + * @method Grid\Column|Collection use_day(string $label = null) + * @method Grid\Column|Collection use_start_at(string $label = null) + * @method Grid\Column|Collection use_end_at(string $label = null) * @method Grid\Column|Collection uuid(string $label = null) * @method Grid\Column|Collection connection(string $label = null) * @method Grid\Column|Collection queue(string $label = null) @@ -177,7 +192,6 @@ namespace Dcat\Admin { * @method Grid\Column|Collection sku_id(string $label = null) * @method Grid\Column|Collection gift_sku_id(string $label = null) * @method Grid\Column|Collection num(string $label = null) - * @method Grid\Column|Collection sent(string $label = null) * @method Grid\Column|Collection attrs(string $label = null) * @method Grid\Column|Collection specs(string $label = null) * @method Grid\Column|Collection part_id(string $label = null) @@ -270,6 +284,14 @@ namespace Dcat\Admin { * @property Show\Field|Collection subtitle * @property Show\Field|Collection cover * @property Show\Field|Collection content + * @property Show\Field|Collection coupon_id + * @property Show\Field|Collection ranges + * @property Show\Field|Collection threshold + * @property Show\Field|Collection limit + * @property Show\Field|Collection sent + * @property Show\Field|Collection use_day + * @property Show\Field|Collection use_start_at + * @property Show\Field|Collection use_end_at * @property Show\Field|Collection uuid * @property Show\Field|Collection connection * @property Show\Field|Collection queue @@ -285,7 +307,6 @@ namespace Dcat\Admin { * @property Show\Field|Collection sku_id * @property Show\Field|Collection gift_sku_id * @property Show\Field|Collection num - * @property Show\Field|Collection sent * @property Show\Field|Collection attrs * @property Show\Field|Collection specs * @property Show\Field|Collection part_id @@ -373,6 +394,14 @@ namespace Dcat\Admin { * @method Show\Field|Collection subtitle(string $label = null) * @method Show\Field|Collection cover(string $label = null) * @method Show\Field|Collection content(string $label = null) + * @method Show\Field|Collection coupon_id(string $label = null) + * @method Show\Field|Collection ranges(string $label = null) + * @method Show\Field|Collection threshold(string $label = null) + * @method Show\Field|Collection limit(string $label = null) + * @method Show\Field|Collection sent(string $label = null) + * @method Show\Field|Collection use_day(string $label = null) + * @method Show\Field|Collection use_start_at(string $label = null) + * @method Show\Field|Collection use_end_at(string $label = null) * @method Show\Field|Collection uuid(string $label = null) * @method Show\Field|Collection connection(string $label = null) * @method Show\Field|Collection queue(string $label = null) @@ -388,7 +417,6 @@ namespace Dcat\Admin { * @method Show\Field|Collection sku_id(string $label = null) * @method Show\Field|Collection gift_sku_id(string $label = null) * @method Show\Field|Collection num(string $label = null) - * @method Show\Field|Collection sent(string $label = null) * @method Show\Field|Collection attrs(string $label = null) * @method Show\Field|Collection specs(string $label = null) * @method Show\Field|Collection part_id(string $label = null) diff --git a/resources/lang/zh_CN/coupon-range.php b/resources/lang/zh_CN/coupon-range.php new file mode 100644 index 00000000..71d96063 --- /dev/null +++ b/resources/lang/zh_CN/coupon-range.php @@ -0,0 +1,17 @@ + [ + 'CouponRange' => 'CouponRange', + 'coupon-range' => 'CouponRange', + ], + 'fields' => [ + 'coupon_id' => '优惠券', + 'type' => '类型', + 'ranges' => '范围', + 'ranges1'=>'选择分类', + 'ranges2'=>'选择商品', + ], + 'options' => [ + ], +]; diff --git a/resources/lang/zh_CN/coupon.php b/resources/lang/zh_CN/coupon.php new file mode 100644 index 00000000..fc23bcca --- /dev/null +++ b/resources/lang/zh_CN/coupon.php @@ -0,0 +1,27 @@ + [ + 'Coupon' => '优惠券', + 'coupons' => '优惠券', + ], + 'fields' => [ + 'coupon' => [ + 'name' => '优惠券', + ], + 'name' => '名称', + 'type' => '券类型', + 'value' => '力度', + 'value1'=>'抵扣金额', + 'value2'=>'折扣', + 'threshold' => '使用门槛', + 'limit' => '限量', + 'sent' => '已发', + 'use_day' => '期限', + 'use_start_at' => '使用开始时间', + 'use_end_at' => '使用结束时间', + 'ranges'=>'范围', + ], + 'options' => [ + ], +];