From 42cade8b99d2635f63fc0d2a219731b59f3db6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E5=B0=98?= <122383162@qq.com> Date: Fri, 7 Aug 2020 13:29:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B8=E9=94=80=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/Activity/IndexController.php | 1 + packages/coupon/src/Action/Init.php | 5 +---- packages/coupon/src/Action/ysd/YsdVerification.php | 12 +++++++----- 3 files changed, 9 insertions(+), 9 deletions(-) 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;