feat(order): 修改订单支付逻辑与地址获取方式

This commit is contained in:
mkm 2024-06-08 20:47:30 +08:00
parent e6acf8b542
commit 6ba088cbda
2 changed files with 2 additions and 3 deletions

View File

@ -306,12 +306,11 @@ class OrderController extends BaseApiController
//微信小程序支付
$redirectUrl = $params['redirect'] ?? '/pages/payment/payment';
if ($addressId != $order['address_id']) {
$address = UserAddress::where(['address_id' => $addressId, 'uid' => Request()->userId])->find();
$address = UserAddress::where(['id' => $addressId, 'uid' => Request()->userId])->find();
if ($address) {
$_order['real_name'] = $address['real_name'];
$_order['user_phone'] = $address['phone'];
$_order['user_address'] = $address['detail'];
$_order['address_id'] = $addressId;
StoreOrder::where(['id' => $order_id, 'uid' => Request()->userId])->update($_order);
}
}

View File

@ -43,7 +43,7 @@ class PaymentLogic extends BaseLogic
$order['pay_price'] = $order['price'];
}
switch ($payWay) {
case PayEnum::WECHAT_PAY:
case PayEnum::WECHAT_PAY_MINI:
$auth = UserAuth::where(['user_id' => $order['uid'], 'terminal' => $terminal])->findOrEmpty();
$order = [
'out_trade_no' => $paySn,