feat(order): 修改订单支付逻辑与地址获取方式
This commit is contained in:
parent
e6acf8b542
commit
6ba088cbda
@ -306,12 +306,11 @@ class OrderController extends BaseApiController
|
|||||||
//微信小程序支付
|
//微信小程序支付
|
||||||
$redirectUrl = $params['redirect'] ?? '/pages/payment/payment';
|
$redirectUrl = $params['redirect'] ?? '/pages/payment/payment';
|
||||||
if ($addressId != $order['address_id']) {
|
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) {
|
if ($address) {
|
||||||
$_order['real_name'] = $address['real_name'];
|
$_order['real_name'] = $address['real_name'];
|
||||||
$_order['user_phone'] = $address['phone'];
|
$_order['user_phone'] = $address['phone'];
|
||||||
$_order['user_address'] = $address['detail'];
|
$_order['user_address'] = $address['detail'];
|
||||||
$_order['address_id'] = $addressId;
|
|
||||||
StoreOrder::where(['id' => $order_id, 'uid' => Request()->userId])->update($_order);
|
StoreOrder::where(['id' => $order_id, 'uid' => Request()->userId])->update($_order);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ class PaymentLogic extends BaseLogic
|
|||||||
$order['pay_price'] = $order['price'];
|
$order['pay_price'] = $order['price'];
|
||||||
}
|
}
|
||||||
switch ($payWay) {
|
switch ($payWay) {
|
||||||
case PayEnum::WECHAT_PAY:
|
case PayEnum::WECHAT_PAY_MINI:
|
||||||
$auth = UserAuth::where(['user_id' => $order['uid'], 'terminal' => $terminal])->findOrEmpty();
|
$auth = UserAuth::where(['user_id' => $order['uid'], 'terminal' => $terminal])->findOrEmpty();
|
||||||
$order = [
|
$order = [
|
||||||
'out_trade_no' => $paySn,
|
'out_trade_no' => $paySn,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user