master
wangxinglong 2022-03-30 18:11:53 +08:00
parent 7cdca1b279
commit cb671bae45
2 changed files with 40 additions and 34 deletions

View File

@ -1023,22 +1023,26 @@ class Coupon extends Base
//未领取的优惠券 //未领取的优惠券
$NotClaimedMoney = CouponRepository::getInstance()->getBusinessNotClaimedCoupon($account->business["code"]); $NotClaimedMoney = CouponRepository::getInstance()->getBusinessNotClaimedCoupon($account->business["code"]);
if( // if(
$account->business["model"] == BusinessModel::model_ordinary // $account->business["model"] == BusinessModel::model_ordinary
|| // ||
( // (
$account->business["model"] == BusinessModel::model_time_limit // $account->business["model"] == BusinessModel::model_time_limit
&& // &&
( // (
(strtotime($account->business["time_limit_end"]) < $time) // (strtotime($account->business["time_limit_end"]) < $time)
|| // ||
($TimeListModeReleaseCount >= $account->business["time_limit_release_count"]) // ($TimeListModeReleaseCount >= $account->business["time_limit_release_count"])
) // )
) // )
) { // ) {
if ($account->business["balance"] < ($totalMoney + $NotClaimedMoney)) { // if ($account->business["balance"] < ($totalMoney + $NotClaimedMoney)) {
return $this->json(4001, '商家余额不足'); // return $this->json(4001, '商家余额不足');
} // }
// }
if ($account->business["balance"] < ($totalMoney + $NotClaimedMoney)) {
return $this->json(4001, '商家余额不足');
} }
Db::startTrans(); Db::startTrans();

View File

@ -326,25 +326,27 @@ class Coupon extends Base
//未领取的优惠券 //未领取的优惠券
$NotClaimedMoney = CouponRepository::getInstance()->getBusinessNotClaimedCoupon($business["code"]); $NotClaimedMoney = CouponRepository::getInstance()->getBusinessNotClaimedCoupon($business["code"]);
if( // if(
$business["model"] == BusinessModel::model_ordinary // $business["model"] == BusinessModel::model_ordinary
|| // ||
( // (
$business["model"] == BusinessModel::model_time_limit // $business["model"] == BusinessModel::model_time_limit
&& // &&
( // (
strtotime($business["time_limit_end"]) < $time // strtotime($business["time_limit_end"]) < $time
|| // ||
$TimeListModeReleaseCount >= $business["time_limit_release_count"] // $TimeListModeReleaseCount >= $business["time_limit_release_count"]
) // )
) // )
){ // ){
if ($business["balance"] < ($totalMoney + $NotClaimedMoney)) { // if ($business["balance"] < ($totalMoney + $NotClaimedMoney)) {
return $this->json(4001, '商家余额不足'); // return $this->json(4001, '商家余额不足');
} // }
// }
if ($business["balance"] < ($totalMoney + $NotClaimedMoney)) {
return $this->json(4001, '商家余额不足');
} }
$date = date("Y-m-d H:i:s"); $date = date("Y-m-d H:i:s");
$data['create_time'] = $date; $data['create_time'] = $date;
$data['update_time'] = $date; $data['update_time'] = $date;