修改核销检查次数
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -126,9 +126,6 @@ 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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user