setter
parent
2899c4b4bf
commit
3000277aa8
|
@ -223,6 +223,13 @@ class Coupon extends Base
|
|||
//执行领取 开启锁
|
||||
return $q->with("business")->lock(true);
|
||||
});
|
||||
if(!isset($couponMain->business)||empty($couponMain->business)){
|
||||
return $this->json(4001, "优惠券所属商家不存在");
|
||||
}
|
||||
|
||||
if($couponMain->business->enable != BusinessModel::COMMON_OFF){
|
||||
return $this->json(4001, "商家已禁用");
|
||||
}
|
||||
|
||||
try {
|
||||
//检查优惠券状态
|
||||
|
@ -370,6 +377,10 @@ class Coupon extends Base
|
|||
return $this->json(4001, "商家不存在");
|
||||
}
|
||||
|
||||
if($business->enable != BusinessModel::COMMON_OFF){
|
||||
return $this->json(4001, "商家已禁用");
|
||||
}
|
||||
|
||||
if($business->balance < $coupon->couponMain->deduction_money){
|
||||
return $this->json(4001, "商家余额不足");
|
||||
}
|
||||
|
@ -520,6 +531,9 @@ class Coupon extends Base
|
|||
if (!isset($account->business) || empty($account->business)) {
|
||||
return $this->json(4001, "商家信息错误");
|
||||
}
|
||||
if($account->business->enable != BusinessModel::COMMON_OFF){
|
||||
return $this->json(4001, "商家已禁用");
|
||||
}
|
||||
$data = input();
|
||||
|
||||
Config::load("extra/distribution_proportion","distribution_proportion");
|
||||
|
|
|
@ -195,6 +195,9 @@ class Coupon extends Base
|
|||
if (empty($business)) {
|
||||
return $this->json(4001, '商家不存在');
|
||||
}
|
||||
if($business->enable != BusinessModel::COMMON_OFF){
|
||||
return $this->json(4001, "商家已禁用");
|
||||
}
|
||||
$validate = new CouponRelease();
|
||||
//普通商家要验证扣除金额
|
||||
if (!$validate->scene($business["model"] ==BusinessModel::model_ordinary?"ordinary":"")->check($data)) {
|
||||
|
|
Loading…
Reference in New Issue