From f1b79f9f1fbc464a76100b1b5ba4312b07ea2dc4 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 19 Oct 2020 15:31:28 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8-=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0tags=E9=97=AE=E9=A2=98=20=E4=BC=98=E6=83=A0=E5=88=B8-?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=BB=9F=E8=AE=A1=E4=BD=BF=E7=94=A8=E6=95=B0?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/v3/CouponController.php | 39 ++++++++++++++++--- app/Models/v3/Coupon.php | 4 +- app/Models/v3/CouponUse.php | 11 +++++- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/app/Admin/Controllers/v3/CouponController.php b/app/Admin/Controllers/v3/CouponController.php index 67653d8..87a3c62 100644 --- a/app/Admin/Controllers/v3/CouponController.php +++ b/app/Admin/Controllers/v3/CouponController.php @@ -15,6 +15,7 @@ use App\Models\v3\Coupon as CouponModel; use App\Models\v3\Market as MarketModel; use App\Models\v3\Category as CategoryModel; use Dcat\Admin\Form\NestedForm; +use App\Models\v3\CouponUse as UseModel; class CouponController extends AdminController { @@ -38,7 +39,12 @@ class CouponController extends AdminController $grid->inventory; $grid->inventory_use; - $grid->use_number; + $grid->use_number->display(function($use){ + $id = $this->id; + $number = UseModel::getUseCount([['coupon_id','=',$id]])->toArray(); + $item = isset($number[0]['total']) ? $number[0]['total'] : 0; + return $item; + }); $grid->active_type_text; $grid->status ->using( @@ -75,6 +81,9 @@ class CouponController extends AdminController $filter->in('status')->multipleSelect($status); }); + $grid->model()->orderBy('id', 'desc'); + // 每页10条 + $grid->paginate(10); $grid->disableBatchDelete(); // $grid->disableCreateButton(); $grid->disableDeleteButton(); @@ -224,13 +233,33 @@ class CouponController extends AdminController // $form->text('usable_number')->width(2)->default(1)->disable(); $form->saving(function (Form $form){ - + $tags = $form->input('tags'); + $activityAvailable = $form->input('activity_available'); if( $form->discount_type == 2 && ($form->discounts <= 0 || $form->discounts >= 10)){ return $form->error('优惠金额请输入1~10之间的数字'); } - $form->activity_available = empty($form->input('activity_available'))? [] : $form->input('activity_available'); - $form->tags = empty($form->input('tags'))? [] : $form->input('tags'); - $form->tags = empty($form->input('tags'))? [] : $form->input('tags'); + $tagsArr = []; + if(!empty($tags)){ + foreach($tags as $kt => $tag){ + if(empty($tag)){ + unset($tags[$kt]); + continue; + } + $tagsArr[] = $tag; + } + }; + $form->tags = json_encode($tagsArr); + $availableArr = []; + if(!empty($activityAvailable)){ + foreach($activityAvailable as $ka => $available){ + if(empty($available)){ + unset($activityAvailable[$ka]); + continue; + } + $availableArr[] = $available; + } + }; + $form->activity_available = json_encode($availableArr); $form->remark = empty($form->input('remark')) ? '' : $form->input('remark'); }); diff --git a/app/Models/v3/Coupon.php b/app/Models/v3/Coupon.php index 785c961..dcf5966 100644 --- a/app/Models/v3/Coupon.php +++ b/app/Models/v3/Coupon.php @@ -47,8 +47,8 @@ class Coupon extends Model protected $casts = [ 'market_ids'=>'array', 'category_ids'=>'array', - 'tags'=>'array', - 'activity_available'=>'array' + // 'tags'=>'json', + // 'activity_available'=>'array' ]; public function getStatusTextAttribute() diff --git a/app/Models/v3/CouponUse.php b/app/Models/v3/CouponUse.php index 9b0fcea..68f8213 100644 --- a/app/Models/v3/CouponUse.php +++ b/app/Models/v3/CouponUse.php @@ -3,12 +3,21 @@ namespace App\Models\v3; use Dcat\Admin\Traits\HasDateTimeFormatter; - use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Facades\DB; class CouponUse extends Model { use HasDateTimeFormatter; protected $table = 'lanzu_coupon_use'; + /** + * 根据条件 获取使用数量 + */ + public static function getUseCount($where) + { + $data = self::select(DB::raw(' COUNT(id) as total,coupon_id'))->where($where)->groupBy('coupon_id')->get(); + return $data; + } + } From 979d334b8c16d9113143519346d1ae9a037c46f4 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 19 Oct 2020 16:29:12 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8--=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Actions/Grid/v3/CouponForbidden.php | 6 +- app/Admin/Actions/Grid/v3/CouponPublish.php | 2 +- app/Admin/Forms/v3/CouponPublishForm.php | 58 +++++++++++-------- app/Models/v3/SystemConfig.php | 2 +- 4 files changed, 40 insertions(+), 28 deletions(-) diff --git a/app/Admin/Actions/Grid/v3/CouponForbidden.php b/app/Admin/Actions/Grid/v3/CouponForbidden.php index 0224d6f..52d63fe 100644 --- a/app/Admin/Actions/Grid/v3/CouponForbidden.php +++ b/app/Admin/Actions/Grid/v3/CouponForbidden.php @@ -18,16 +18,16 @@ class CouponForbidden extends RowAction $id = $this->getKey(); $coupon = CouponModel::getInfo($id); if(empty($coupon)){ - return $this->response()->success('找不到优惠券!'); + return $this->response()->error('找不到优惠券!'); }else if($coupon->status == 1){ $coupon->status = 3; if($coupon->save()){ - return $this->response()->success('禁用成功!','/coupon'); + return $this->response()->redirect('/coupon'); } }else if($coupon->status == 3){ return $this->response()->error('优惠券已禁用!'); } - return $this->response()->success('禁用失败!'); + return $this->response()->error('禁用失败!'); } // 确认弹窗信息 diff --git a/app/Admin/Actions/Grid/v3/CouponPublish.php b/app/Admin/Actions/Grid/v3/CouponPublish.php index 9a98a4c..159216c 100644 --- a/app/Admin/Actions/Grid/v3/CouponPublish.php +++ b/app/Admin/Actions/Grid/v3/CouponPublish.php @@ -20,7 +20,7 @@ class CouponPublish extends RowAction $modal = Modal::make() ->xl() ->title($this->title) - ->body(CouponPublishForm::make()->setKey($id)) + ->body(CouponPublishForm::make()->setKey($id)->payload(['id'=>$this->row->id,'status'=>$this->row->status,'title'=>$this->row->title])) ->button($this->title); return $modal; diff --git a/app/Admin/Forms/v3/CouponPublishForm.php b/app/Admin/Forms/v3/CouponPublishForm.php index 668d64b..d1959f1 100644 --- a/app/Admin/Forms/v3/CouponPublishForm.php +++ b/app/Admin/Forms/v3/CouponPublishForm.php @@ -8,10 +8,12 @@ use Symfony\Component\HttpFoundation\Response; use App\Models\v3\CouponReceiveType as ReceiveTypeModel; use App\Models\v3\CouponSetting as SettingModel; use App\Models\v3\Coupon as CouponModel; +use Dcat\Admin\Contracts\LazyRenderable; +use Dcat\Admin\Traits\LazyWidget; -class CouponPublishForm extends Form +class CouponPublishForm extends Form implements LazyRenderable { - + use LazyWidget; /** * Handle the form request. * @@ -39,24 +41,26 @@ class CouponPublishForm extends Form return $this->error('活动时间已经接近,请重新设置!'); } - $coupon->status = 1; - if(!$coupon->save()){ - return $this->error('发布失败!'); + if($coupon->status == 0){ + // 删除领取方式 + $delRes = ReceiveTypeModel::where('coupon_id',$id)->delete(); + if($delRes === false){ + return $this->error('发布失败!'); + } + // 添加领取方式 + $receiveModel = new ReceiveTypeModel(); + $receiveModel->coupon_id = $id; + $receiveModel->receive_type = $receiveType; + // 获取一次可领取数量 + $receiveNumber = SettingModel::getSettingInfo($receiveType,'value'); + $receiveModel->one_receive_number = empty($receiveNumber) ? 1 : $receiveNumber->value; + if(!$receiveModel->save()){ + return $this->error('发布失败!'); + } } - // 删除领取方式 - $delRes = ReceiveTypeModel::where('coupon_id',$id)->delete(); - if($delRes === false){ - return $this->error('发布失败!'); - } - // 添加领取方式 - $receiveModel = new ReceiveTypeModel(); - $receiveModel->coupon_id = $id; - $receiveModel->receive_type = $receiveType; - // 获取一次可领取数量 - $receiveNumber = SettingModel::getSettingInfo($receiveType,'value'); - $receiveModel->one_receive_number = empty($receiveNumber) ? 1 : $receiveNumber->value; - - if($receiveModel->save()){ + + $coupon->status = 1; + if($coupon->save()){ return $this->success('发布成功','/coupon'); } break; @@ -78,12 +82,20 @@ class CouponPublishForm extends Form */ public function form() { - $id = $this->getKey(); - $receiveTypeInfo = ReceiveTypeModel::getReceiveTypeInfo($id,'receive_type'); + $id = $this->payload['id'] ?? 0; + $title = $this->payload['title'] ?? ''; + $status = $this->payload['status'] ?? -1; + + $this->hidden('id')->value($id); + $this->display('title','标题')->value($title); + $receiveTypeInfo = ReceiveTypeModel::getReceiveTypeOne([['coupon_id','=',$id]],'receive_type'); $list = SettingModel::getSettingArray(); $receiveType = empty($receiveTypeInfo->receive_type)? 0 :$receiveTypeInfo->receive_type; - $this->hidden('id')->value($id); - $this->select('receive_type','领取方式')->required()->options($list)->value($receiveType); + if($status == 0){ + $this->select('receive_type','领取方式')->required()->options($list)->value($receiveType); + }else{ + $this->select('receive_type','领取方式')->options($list)->value($receiveType)->disable(); + } } /** diff --git a/app/Models/v3/SystemConfig.php b/app/Models/v3/SystemConfig.php index 5976adc..0f52534 100644 --- a/app/Models/v3/SystemConfig.php +++ b/app/Models/v3/SystemConfig.php @@ -17,7 +17,7 @@ class SystemConfig extends Model /* 查询记录数 limit */ protected $perPage = 10; - public static $_CATEGORY= [1=>'奖励类',2=>'店铺设置类',3=>'市场管理后台配置',4=>'订单相关设置']; + public static $_CATEGORY= [1=>'奖励类',2=>'店铺设置类',3=>'市场管理后台配置',4=>'订单相关设置',5=>'提现设置']; public static $_STATUS = ['禁用','启用']; protected $appends = [ From 1f6dcf7af7e7c42106fa5b5f5272dc6af3f9024b Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 19 Oct 2020 17:02:17 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8--=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BF=AB=E6=8D=B7=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Actions/Grid/v3/CouponTime.php | 52 ++++++++ app/Admin/Controllers/v3/CouponController.php | 5 +- app/Admin/Forms/v3/CouponTimeForm.php | 113 ++++++++++++++++++ app/Models/v3/Coupon.php | 4 +- 4 files changed, 171 insertions(+), 3 deletions(-) create mode 100644 app/Admin/Actions/Grid/v3/CouponTime.php create mode 100644 app/Admin/Forms/v3/CouponTimeForm.php diff --git a/app/Admin/Actions/Grid/v3/CouponTime.php b/app/Admin/Actions/Grid/v3/CouponTime.php new file mode 100644 index 0000000..638f91e --- /dev/null +++ b/app/Admin/Actions/Grid/v3/CouponTime.php @@ -0,0 +1,52 @@ +getKey(); + + $modal = Modal::make() + ->xl() + ->title($this->title) + ->body(CouponTimeForm::make()->setKey($id)->payload([ + 'id'=>$this->row->id, + 'status'=>$this->row->status, + 'title'=>$this->row->title, + 'start_time'=>$this->row->start_time, + 'end_time'=>$this->row->end_time, + 'usable_start_time'=>$this->row->usable_start_time, + 'usable_end_time'=>$this->row->usable_end_time, + ])) + ->button($this->title); + + return $modal; + } + + // 确认弹窗信息 + public function confirm() + { + return '您确定要修改时间吗?'; + } + + public function parameters() + { + + return [ + + ]; + } +} diff --git a/app/Admin/Controllers/v3/CouponController.php b/app/Admin/Controllers/v3/CouponController.php index 87a3c62..380da47 100644 --- a/app/Admin/Controllers/v3/CouponController.php +++ b/app/Admin/Controllers/v3/CouponController.php @@ -4,6 +4,7 @@ namespace App\Admin\Controllers\v3; use App\Admin\Actions\Grid\v3\CouponForbidden; use App\Admin\Actions\Grid\v3\CouponPublish; +use App\Admin\Actions\Grid\v3\CouponTime; use App\Admin\Repositories\v3\Coupon; use Dcat\Admin\Form; use Dcat\Admin\Grid; @@ -59,6 +60,7 @@ class CouponController extends AdminController $grid->actions(function (Grid\Displayers\Actions $actions) use($grid){ if(in_array($this->status,[0,3])){ $actions->append(new CouponPublish()); + $actions->append(new CouponTime()); if($this->status == 3){ $actions->disableEdit(); } @@ -67,6 +69,7 @@ class CouponController extends AdminController $actions->disableEdit(); if($this->status == 1){ $actions->append(new CouponForbidden()); + $actions->append(new CouponTime()); } } }); @@ -137,7 +140,7 @@ class CouponController extends AdminController return $text; }); // $show->category_ids->as(function($storeTypeId){ - // $text = '全部店铺类型'; + // $text = '全部类型'; // if($storeTypeId > 0){ // $storeType = storeTypeModel::select('type_name')->find($storeTypeId)->toArray(); // $text = $storeType ? $storeType['type_name'] : $text ; diff --git a/app/Admin/Forms/v3/CouponTimeForm.php b/app/Admin/Forms/v3/CouponTimeForm.php new file mode 100644 index 0000000..0a93432 --- /dev/null +++ b/app/Admin/Forms/v3/CouponTimeForm.php @@ -0,0 +1,113 @@ +error('优惠券不存在或已删除!'); + } + + switch($coupon->status){ + case 0: + case 1: + case 3: + $coupon->start_time = $start_time; + $coupon->end_time = $end_time; + $coupon->usable_start_time = $usable_start_time; + $coupon->usable_end_time = $usable_end_time; + if($coupon->save()){ + return $this->success('修改成功','/coupon'); + } + break; + case 2: + return $this->error('优惠券已领完!'); + break; + case -1: + return $this->error('优惠券已删除!'); + break; + } + return $this->error('发布失败!'); + } + + /** + * Build a form here. + */ + public function form() + { + $id = $this->payload['id'] ?? 0; + $title = $this->payload['title'] ?? ''; + $status = $this->payload['status'] ?? -1; + + $start_time = $this->payload['start_time'] ?? ''; + $end_time = $this->payload['end_time'] ?? ''; + $usable_start_time = $this->payload['usable_start_time'] ?? ''; + $usable_end_time = $this->payload['usable_end_time'] ?? ''; + + $this->hidden('id')->value($id); + $this->display('title','标题')->value($title); + + $this->datetime('start_time','活动开始时间')->required() + ->customFormat(function () use($start_time){ + return date('Y-m-d H:i:s',$start_time); + }); + + $this->datetime('end_time','活动结束时间')->required() + ->customFormat(function () use($end_time){ + return date('Y-m-d H:i:s',$end_time); + }) + ->rules('after:start_time',[ + 'after' => '只能选择活动开始之后的时间' + ]); + $this->datetime('usable_start_time','可用开始时间')->required() + ->customFormat(function () use($usable_start_time){ + return date('Y-m-d H:i:s',$usable_start_time); + }); + $this->datetime('usable_end_time','可用结束时间')->required() + ->customFormat(function () use($usable_end_time){ + return date('Y-m-d H:i:s',$usable_end_time); + }) + ->rules('after:end_time',[ + 'after' => '只能选择活动结束之后的时间' + ]); + } + + /** + * The data of the form. + * + * @return array + */ + public function default() + { + return []; + } + +} diff --git a/app/Models/v3/Coupon.php b/app/Models/v3/Coupon.php index dcf5966..db5e89c 100644 --- a/app/Models/v3/Coupon.php +++ b/app/Models/v3/Coupon.php @@ -95,12 +95,12 @@ class Coupon extends Model public function getEndTimeTextAttribute() { - $value = $this->usable_start_time; + $value = $this->end_time; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getUsableStartTimeTextAttribute() { - $value = $this->start_time; + $value = $this->usable_start_time; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getUsableEndTimeTextAttribute() From 9fa7f7a802fcff3491da39e05d30c41127d2aa52 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 19 Oct 2020 17:11:26 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8--=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BA=93=E5=AD=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Actions/Grid/v3/CouponTime.php | 2 +- app/Admin/Forms/v3/CouponTimeForm.php | 26 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/Admin/Actions/Grid/v3/CouponTime.php b/app/Admin/Actions/Grid/v3/CouponTime.php index 638f91e..246fe0a 100644 --- a/app/Admin/Actions/Grid/v3/CouponTime.php +++ b/app/Admin/Actions/Grid/v3/CouponTime.php @@ -24,7 +24,7 @@ class CouponTime extends RowAction ->title($this->title) ->body(CouponTimeForm::make()->setKey($id)->payload([ 'id'=>$this->row->id, - 'status'=>$this->row->status, + 'inventory'=>$this->row->inventory, 'title'=>$this->row->title, 'start_time'=>$this->row->start_time, 'end_time'=>$this->row->end_time, diff --git a/app/Admin/Forms/v3/CouponTimeForm.php b/app/Admin/Forms/v3/CouponTimeForm.php index 0a93432..e18bc21 100644 --- a/app/Admin/Forms/v3/CouponTimeForm.php +++ b/app/Admin/Forms/v3/CouponTimeForm.php @@ -25,7 +25,7 @@ class CouponTimeForm extends Form implements LazyRenderable { // 获取外部传递参数 $id = $input['id']; - + $inventory = $input['inventory'] ?? 0; $start_time = $input['start_time'] ?? ''; $end_time = $input['end_time'] ?? ''; $usable_start_time = $input['usable_start_time'] ?? ''; @@ -40,10 +40,22 @@ class CouponTimeForm extends Form implements LazyRenderable case 0: case 1: case 3: - $coupon->start_time = $start_time; - $coupon->end_time = $end_time; - $coupon->usable_start_time = $usable_start_time; - $coupon->usable_end_time = $usable_end_time; + if(!empty($inventory)){ + $coupon->inventory = $inventory; + } + if(!empty($inventory)){ + $coupon->start_time = $start_time; + } + if(!empty($inventory)){ + $coupon->end_time = $end_time; + } + if(!empty($inventory)){ + $coupon->usable_start_time = $usable_start_time; + } + if(!empty($inventory)){ + $coupon->usable_end_time = $usable_end_time; + } + if($coupon->save()){ return $this->success('修改成功','/coupon'); } @@ -65,7 +77,7 @@ class CouponTimeForm extends Form implements LazyRenderable { $id = $this->payload['id'] ?? 0; $title = $this->payload['title'] ?? ''; - $status = $this->payload['status'] ?? -1; + $inventory = $this->payload['inventory'] ?? 0; $start_time = $this->payload['start_time'] ?? ''; $end_time = $this->payload['end_time'] ?? ''; @@ -75,6 +87,8 @@ class CouponTimeForm extends Form implements LazyRenderable $this->hidden('id')->value($id); $this->display('title','标题')->value($title); + $this->number('inventory','发放数量')->required()->type('number')->attribute('min', 1)->value($inventory)->default(1); + $this->datetime('start_time','活动开始时间')->required() ->customFormat(function () use($start_time){ return date('Y-m-d H:i:s',$start_time); From d3733b4bb5463dcd8573eee4bcb01dcb75982521 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 19 Oct 2020 18:12:15 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=B7=A5=E5=85=B7=E8=A1=A8=E5=8D=95--?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Forms/v3/CategoryTieForm.php | 2 +- app/Admin/Forms/v3/CouponPublishForm.php | 2 +- app/Admin/Forms/v3/CouponTimeForm.php | 4 +--- app/Admin/Forms/v3/GoodsActivityCopyForm.php | 2 +- app/Admin/Forms/v3/GoodsImageForm.php | 1 + app/Admin/Forms/v3/GoodsSpecForm.php | 2 -- app/Admin/Forms/v3/StoreUserPasswordForm.php | 1 - 7 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/Admin/Forms/v3/CategoryTieForm.php b/app/Admin/Forms/v3/CategoryTieForm.php index 535c308..b502e9e 100644 --- a/app/Admin/Forms/v3/CategoryTieForm.php +++ b/app/Admin/Forms/v3/CategoryTieForm.php @@ -6,7 +6,6 @@ use Dcat\Admin\Widgets\Form; use Symfony\Component\HttpFoundation\Response; use App\Libs\SsdbClient; use App\Models\v3\Category as CategoryModel; -use Illuminate\Support\Facades\DB; class CategoryTieForm extends Form { @@ -59,6 +58,7 @@ class CategoryTieForm extends Form $parentList = CategoryModel::where('parent_id',0)->pluck('title','id')->toArray(); $this->multipleSelect('category_ids','选择分类')->required()->options($parentList)->value($select)->default($select); + $this->disableResetButton(); } /** diff --git a/app/Admin/Forms/v3/CouponPublishForm.php b/app/Admin/Forms/v3/CouponPublishForm.php index d1959f1..f17cfc0 100644 --- a/app/Admin/Forms/v3/CouponPublishForm.php +++ b/app/Admin/Forms/v3/CouponPublishForm.php @@ -2,7 +2,6 @@ namespace App\Admin\Forms\v3; -use App\Models\v3\GoodsBanners; use Dcat\Admin\Widgets\Form; use Symfony\Component\HttpFoundation\Response; use App\Models\v3\CouponReceiveType as ReceiveTypeModel; @@ -96,6 +95,7 @@ class CouponPublishForm extends Form implements LazyRenderable }else{ $this->select('receive_type','领取方式')->options($list)->value($receiveType)->disable(); } + $this->disableResetButton(); } /** diff --git a/app/Admin/Forms/v3/CouponTimeForm.php b/app/Admin/Forms/v3/CouponTimeForm.php index e18bc21..ece9636 100644 --- a/app/Admin/Forms/v3/CouponTimeForm.php +++ b/app/Admin/Forms/v3/CouponTimeForm.php @@ -2,11 +2,8 @@ namespace App\Admin\Forms\v3; -use App\Models\v3\GoodsBanners; use Dcat\Admin\Widgets\Form; use Symfony\Component\HttpFoundation\Response; -use App\Models\v3\CouponReceiveType as ReceiveTypeModel; -use App\Models\v3\CouponSetting as SettingModel; use App\Models\v3\Coupon as CouponModel; use Dcat\Admin\Contracts\LazyRenderable; use Dcat\Admin\Traits\LazyWidget; @@ -112,6 +109,7 @@ class CouponTimeForm extends Form implements LazyRenderable ->rules('after:end_time',[ 'after' => '只能选择活动结束之后的时间' ]); + $this->disableResetButton(); } /** diff --git a/app/Admin/Forms/v3/GoodsActivityCopyForm.php b/app/Admin/Forms/v3/GoodsActivityCopyForm.php index d3f2d51..0f360d7 100644 --- a/app/Admin/Forms/v3/GoodsActivityCopyForm.php +++ b/app/Admin/Forms/v3/GoodsActivityCopyForm.php @@ -4,7 +4,6 @@ */ namespace App\Admin\Forms\v3; -use Dcat\Admin\Models\Administrator; use Dcat\Admin\Traits\LazyWidget; use Dcat\Admin\Widgets\Form; use Dcat\Admin\Contracts\LazyRenderable; @@ -121,6 +120,7 @@ class GoodsActivityCopyForm extends Form implements LazyRenderable $this->number('time_limit_num','限制购买数量')->default(1)->help('A时间段内限购的数量'); $this->switch('can_use_coupon','可同时使用优惠券')->default(0); $this->select('type','活动类型')->options(GoodsModel::$_TYPE)->default('flash_sale'); + $this->disableResetButton(); } /** diff --git a/app/Admin/Forms/v3/GoodsImageForm.php b/app/Admin/Forms/v3/GoodsImageForm.php index 0ae6a76..ed336ab 100644 --- a/app/Admin/Forms/v3/GoodsImageForm.php +++ b/app/Admin/Forms/v3/GoodsImageForm.php @@ -58,6 +58,7 @@ class GoodsImageForm extends Form $this->display('name','商品名称')->value($goodName); $this->image('cover_img','封面图')->autoUpload(); $this->image('img_banner','轮播图')->autoUpload(); + $this->disableResetButton(); } /** diff --git a/app/Admin/Forms/v3/GoodsSpecForm.php b/app/Admin/Forms/v3/GoodsSpecForm.php index 05b4fb2..cdc43b6 100644 --- a/app/Admin/Forms/v3/GoodsSpecForm.php +++ b/app/Admin/Forms/v3/GoodsSpecForm.php @@ -2,11 +2,9 @@ namespace App\Admin\Forms\v3; -use App\Models\v3\GoodsBanners; use Dcat\Admin\Widgets\Form; use Symfony\Component\HttpFoundation\Response; use App\Models\v3\Goods as GoodsModel; -use App\Models\v3\GoodsBanners as GoodsBannerModel; use Dcat\Admin\Form\NestedForm; class GoodsSpecForm extends Form diff --git a/app/Admin/Forms/v3/StoreUserPasswordForm.php b/app/Admin/Forms/v3/StoreUserPasswordForm.php index 41fd5db..d362557 100644 --- a/app/Admin/Forms/v3/StoreUserPasswordForm.php +++ b/app/Admin/Forms/v3/StoreUserPasswordForm.php @@ -2,7 +2,6 @@ namespace App\Admin\Forms\v3; -use App\Models\v3\GoodsBanners; use Dcat\Admin\Widgets\Form; use Symfony\Component\HttpFoundation\Response; use App\Models\v3\StoreUser as StoreUserModel; From 1ad1d7e12d5be9a0992a23774db2911672ae006b Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 19 Oct 2020 18:16:24 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8--=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Actions/Grid/v3/CouponTime.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Admin/Actions/Grid/v3/CouponTime.php b/app/Admin/Actions/Grid/v3/CouponTime.php index 246fe0a..3f6be58 100644 --- a/app/Admin/Actions/Grid/v3/CouponTime.php +++ b/app/Admin/Actions/Grid/v3/CouponTime.php @@ -4,7 +4,6 @@ namespace App\Admin\Actions\Grid\v3; use Dcat\Admin\Grid\RowAction; use Dcat\Admin\Widgets\Modal; -use App\Admin\Forms\v3\CouponPublishForm; use App\Admin\Forms\v3\CouponTimeForm; class CouponTime extends RowAction