diff --git a/app/controller/api/Coupon.php b/app/controller/api/Coupon.php index cf8550a..b6d5610 100644 --- a/app/controller/api/Coupon.php +++ b/app/controller/api/Coupon.php @@ -513,7 +513,7 @@ class Coupon extends Base ) { $businessModel = BusinessModel::model_ordinary; } - + if ($business['balance'] < $coupon->couponMain->deduction_money) { return $this->json(4001, "商家余额不足"); } @@ -1023,22 +1023,26 @@ class Coupon extends Base //未领取的优惠券 $NotClaimedMoney = CouponRepository::getInstance()->getBusinessNotClaimedCoupon($account->business["code"]); - if( - $account->business["model"] == BusinessModel::model_ordinary - || - ( - $account->business["model"] == BusinessModel::model_time_limit - && - ( - (strtotime($account->business["time_limit_end"]) < $time) - || - ($TimeListModeReleaseCount >= $account->business["time_limit_release_count"]) - ) - ) - ) { - if ($account->business["balance"] < ($totalMoney + $NotClaimedMoney)) { - return $this->json(4001, '商家余额不足'); - } +// if( +// $account->business["model"] == BusinessModel::model_ordinary +// || +// ( +// $account->business["model"] == BusinessModel::model_time_limit +// && +// ( +// (strtotime($account->business["time_limit_end"]) < $time) +// || +// ($TimeListModeReleaseCount >= $account->business["time_limit_release_count"]) +// ) +// ) +// ) { +// if ($account->business["balance"] < ($totalMoney + $NotClaimedMoney)) { +// return $this->json(4001, '商家余额不足'); +// } +// } + + if ($account->business["balance"] < ($totalMoney + $NotClaimedMoney)) { + return $this->json(4001, '商家余额不足'); } Db::startTrans(); diff --git a/app/controller/manager/Coupon.php b/app/controller/manager/Coupon.php index 0c2d33d..e3a64ee 100644 --- a/app/controller/manager/Coupon.php +++ b/app/controller/manager/Coupon.php @@ -326,25 +326,27 @@ class Coupon extends Base //未领取的优惠券 $NotClaimedMoney = CouponRepository::getInstance()->getBusinessNotClaimedCoupon($business["code"]); - if( - $business["model"] == BusinessModel::model_ordinary - || - ( - $business["model"] == BusinessModel::model_time_limit - && - ( - strtotime($business["time_limit_end"]) < $time - || - $TimeListModeReleaseCount >= $business["time_limit_release_count"] - ) - ) - ){ - if ($business["balance"] < ($totalMoney + $NotClaimedMoney)) { - return $this->json(4001, '商家余额不足'); - } +// if( +// $business["model"] == BusinessModel::model_ordinary +// || +// ( +// $business["model"] == BusinessModel::model_time_limit +// && +// ( +// strtotime($business["time_limit_end"]) < $time +// || +// $TimeListModeReleaseCount >= $business["time_limit_release_count"] +// ) +// ) +// ){ +// if ($business["balance"] < ($totalMoney + $NotClaimedMoney)) { +// return $this->json(4001, '商家余额不足'); +// } +// } + if ($business["balance"] < ($totalMoney + $NotClaimedMoney)) { + return $this->json(4001, '商家余额不足'); } - $date = date("Y-m-d H:i:s"); $data['create_time'] = $date; $data['update_time'] = $date;