This commit is contained in:
mkm 2024-07-02 16:02:35 +08:00
commit 63e86b21d7
2 changed files with 16 additions and 2 deletions

View File

@ -378,12 +378,13 @@ class StoreOrderLogic extends BaseLogic
}
$template = getenv('SMS_TEMPLATE');
$check =(new SmsService())->client($phone,$template,$code);
if($check){
if($type == 1){
$remark = $param['uid'].'_smsPay';
}else{
}elseif($type == 2){
$remark = $param['uid'].'_giftPay';
}else{
$remark = $param['uid'].'_moneyPay';//余额支付
}
Cache::set($remark,$code,5*60);
return true;

View File

@ -118,6 +118,10 @@ class StoreOrderController extends BaseAdminController
if ($order['order']['pay_price'] > $user['integral']) {
return $this->fail('当前用户礼品券不足支付');
}
}elseif($params['type'] == 3){
if ($order['order']['pay_price'] > $user['now_money']) {
return $this->fail('当前用户余额不足支付');
}
}
$res = (new StoreOrderLogic())->dealSendSms($params, $params['type']);
@ -165,6 +169,15 @@ class StoreOrderController extends BaseAdminController
}
}
if ($pay_type == PayEnum::BALANCE_PAY) {
$remark = $uid . '_moneyPay';
$code = Cache::get($remark);
if ($code && isset($params['code']) && $code != $params['code']) {
throw new Exception('验证码错误');
}
}
$user = null;
if ($uid) {
$user = User::where('id', $uid)->find();