修改核销检查次数

This commit is contained in:
2020-08-07 13:29:55 +08:00
parent 6ee14ab052
commit 42cade8b99
3 changed files with 9 additions and 9 deletions

View File

@@ -109,6 +109,7 @@ class IndexController extends AdminController
->required(); ->required();
$form->switch('status', '状态')->default(1); $form->switch('status', '状态')->default(1);
$form->switch('need_check', '校验')->default(1);
$form->saving(function (Form $form) { $form->saving(function (Form $form) {
$request = request(); $request = request();
if ($request->type == Activity::TYPE_EXTEND && empty($request->days)) { if ($request->type == Activity::TYPE_EXTEND && empty($request->days)) {

View File

@@ -126,9 +126,6 @@ class Init
public function CheckCount() public function CheckCount()
{ {
//排除本时生活渠道 //排除本时生活渠道
if ($this->user && $this->user->id == 6) {
return true;
}
$check_count = Coupon::where('outletId', $this->outletId) $check_count = Coupon::where('outletId', $this->outletId)
->where('total', $this->total) ->where('total', $this->total)

View File

@@ -20,16 +20,18 @@ class YsdVerification extends Init
*/ */
public function start() public function start()
{ {
//检查可核销次数
$ret = $this->CheckCount();
if ($ret !== true) {
return $ret;
}
//查询卡券信息 //查询卡券信息
$this->query_coupon = (new YsdQuery)->setOutletId($this->outletId) $this->query_coupon = (new YsdQuery)->setOutletId($this->outletId)
->setCode($this->redemptionCode) ->setCode($this->redemptionCode)
->start(); ->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)) { if (is_string($this->query_coupon)) {
return $this->query_coupon; return $this->query_coupon;