diff --git a/app/controller/api/Coupon.php b/app/controller/api/Coupon.php index 02e12c8..6d832a2 100644 --- a/app/controller/api/Coupon.php +++ b/app/controller/api/Coupon.php @@ -946,8 +946,7 @@ class Coupon extends Base $validate = new CouponRelease(); //普通商家要验证扣除金额 - - if (!$validate->scene($account->business["model"] == BusinessModel::model_ordinary ? "ordinary" : "")->check($couponMain)) { + if (!$validate->scene(($account->business["model"] == BusinessModel::model_ordinary )? "ordinary" : "")->check($couponMain)) { return $this->json(4001, $validate->getError()); } diff --git a/app/controller/manager/Coupon.php b/app/controller/manager/Coupon.php index 45e4150..85b8b17 100644 --- a/app/controller/manager/Coupon.php +++ b/app/controller/manager/Coupon.php @@ -188,11 +188,10 @@ class Coupon extends Base } $validate = new CouponRelease(); //普通商家要验证扣除金额 - if (!$validate->scene(($business["model"] == BusinessModel::model_ordinary)?"ordinary":"")->check($data)) { + if (!$validate->scene(($business["model"] == BusinessModel::model_ordinary) ? "ordinary" : "")->check($data)) { return $this->json(4001, $validate->getError()); } - //$usingRuleValidate = new CouponUsingRule(); //if (!$usingRuleValidate->check($usingRule)) { // return $this->json(4001, $usingRuleValidate->getError()); diff --git a/app/validate/CouponRelease.php b/app/validate/CouponRelease.php index db2dc93..bd9610c 100644 --- a/app/validate/CouponRelease.php +++ b/app/validate/CouponRelease.php @@ -48,7 +48,8 @@ class CouponRelease extends Validate // edit 验证场景定义 public function sceneOrdinary() { - return $this->append('checkDeductionMoney'); + + return $this->append("deduction_money",'checkDeductionMoney'); } protected function checkEndTime($value, $rule, $data = [])