feat: 修改了条码支付逻辑和订单逻辑

This commit is contained in:
mkm 2024-07-01 12:01:43 +08:00
parent f878847d28
commit 970202fdc7
2 changed files with 2 additions and 2 deletions

View File

@ -110,7 +110,7 @@ class StoreController extends BaseApiController
$order['pay_price']=$order['price']; $order['pay_price']=$order['price'];
$result = PaymentLogic::codepay($auth_code, $order,'条码支付'); $result = PaymentLogic::codepay($auth_code, $order,'条码支付');
if (PaymentLogic::hasError()) { if (PaymentLogic::hasError()) {
return $this->fail(PaymentLogic::getError(), $params); return $this->fail(PaymentLogic::getError());
} }
if (isset($result['trade_state_desc']) && $result['trade_state_desc'] == '支付成功') { if (isset($result['trade_state_desc']) && $result['trade_state_desc'] == '支付成功') {
PayNotifyLogic::handle('recharge', $result['out_trade_no'], $result); PayNotifyLogic::handle('recharge', $result['out_trade_no'], $result);

View File

@ -103,7 +103,7 @@ class OrderLogic extends BaseLogic
$cart_select[$k]['vip_price'] = bcmul($v['cart_num'], $find['vip_price'], 2) ?? 0; //vip售价 $cart_select[$k]['vip_price'] = bcmul($v['cart_num'], $find['vip_price'], 2) ?? 0; //vip售价
if($cart_select[$k]['total_price']>$cart_select[$k]['pay_price']){ if($cart_select[$k]['total_price']>$cart_select[$k]['pay_price']){
$deduction_price=bcsub($cart_select[$k]['total_price'],$find['deduction_price'],2); $deduction_price=bcsub($cart_select[$k]['total_price'],$cart_select[$k]['pay_price'],2);
$cart_select[$k]['deduction_price'] =$deduction_price;//抵扣金额 $cart_select[$k]['deduction_price'] =$deduction_price;//抵扣金额
} }
$cart_select[$k]['product_id'] = $find['product_id']; $cart_select[$k]['product_id'] = $find['product_id'];