master
wangxinglong 2022-03-24 11:08:28 +08:00
parent ec8a7d5df1
commit b32a6edb78
3 changed files with 4 additions and 5 deletions

View File

@ -946,8 +946,7 @@ class Coupon extends Base
$validate = new CouponRelease(); $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()); return $this->json(4001, $validate->getError());
} }

View File

@ -188,11 +188,10 @@ class Coupon extends Base
} }
$validate = new CouponRelease(); $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()); return $this->json(4001, $validate->getError());
} }
//$usingRuleValidate = new CouponUsingRule(); //$usingRuleValidate = new CouponUsingRule();
//if (!$usingRuleValidate->check($usingRule)) { //if (!$usingRuleValidate->check($usingRule)) {
// return $this->json(4001, $usingRuleValidate->getError()); // return $this->json(4001, $usingRuleValidate->getError());

View File

@ -48,7 +48,8 @@ class CouponRelease extends Validate
// edit 验证场景定义 // edit 验证场景定义
public function sceneOrdinary() public function sceneOrdinary()
{ {
return $this->append('checkDeductionMoney');
return $this->append("deduction_money",'checkDeductionMoney');
} }
protected function checkEndTime($value, $rule, $data = []) protected function checkEndTime($value, $rule, $data = [])