diff --git a/app/Admin/Controllers/Activity/IndexController.php b/app/Admin/Controllers/Activity/IndexController.php index b5d7a1e..12583e0 100644 --- a/app/Admin/Controllers/Activity/IndexController.php +++ b/app/Admin/Controllers/Activity/IndexController.php @@ -109,6 +109,7 @@ class IndexController extends AdminController ->required(); $form->switch('status', '状态')->default(1); + $form->switch('need_check', '校验')->default(1); $form->saving(function (Form $form) { $request = request(); if ($request->type == Activity::TYPE_EXTEND && empty($request->days)) { diff --git a/packages/coupon/src/Action/Init.php b/packages/coupon/src/Action/Init.php index bba9751..6c00412 100644 --- a/packages/coupon/src/Action/Init.php +++ b/packages/coupon/src/Action/Init.php @@ -126,10 +126,7 @@ class Init public function CheckCount() { //排除本时生活渠道 - if ($this->user && $this->user->id == 6) { - return true; - } - + $check_count = Coupon::where('outletId', $this->outletId) ->where('total', $this->total) ->where('status', 2) diff --git a/packages/coupon/src/Action/ysd/YsdVerification.php b/packages/coupon/src/Action/ysd/YsdVerification.php index f435a39..0bbc9fa 100644 --- a/packages/coupon/src/Action/ysd/YsdVerification.php +++ b/packages/coupon/src/Action/ysd/YsdVerification.php @@ -20,16 +20,18 @@ class YsdVerification extends Init */ public function start() { - //检查可核销次数 - $ret = $this->CheckCount(); - if ($ret !== true) { - return $ret; - } //查询卡券信息 $this->query_coupon = (new YsdQuery)->setOutletId($this->outletId) ->setCode($this->redemptionCode) ->start(); + //检查可核销次数 + if ($this->query_coupon->activity && $this->query_coupon->activity->need_check) { + $ret = $this->CheckCount(); + if ($ret !== true) { + return $ret; + } + } if (is_string($this->query_coupon)) { return $this->query_coupon;