更新支付
This commit is contained in:
parent
9870729a88
commit
d347c5b78f
@ -225,7 +225,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
}
|
}
|
||||||
$svip_discount = 0;
|
$svip_discount = 0;
|
||||||
$realPrice = $this->cartByPrice($cart);
|
$realPrice = $this->cartByPrice($cart);
|
||||||
$procure = $this->cartByPrice($cart,1);
|
|
||||||
if (in_array($source, [9, 10, 11, 12, 13])) {
|
if (in_array($source, [9, 10, 11, 12, 13])) {
|
||||||
if ($realPrice == 0) {
|
if ($realPrice == 0) {
|
||||||
throw new ValidateException('价格必须大于0');
|
throw new ValidateException('价格必须大于0');
|
||||||
@ -235,8 +234,6 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$cart['productAttr']['stock'] = $cart['cart_num'];
|
$cart['productAttr']['stock'] = $cart['cart_num'];
|
||||||
}
|
}
|
||||||
$price = bcmul($cart['cart_num'], $realPrice, 2);
|
$price = bcmul($cart['cart_num'], $realPrice, 2);
|
||||||
$procure_price = bcmul($cart['cart_num'], $procure, 2);
|
|
||||||
$cart['procure_price'] = $procure_price;
|
|
||||||
$cart['total_price'] = $price;
|
$cart['total_price'] = $price;
|
||||||
$cart['postage_price'] = 0;
|
$cart['postage_price'] = 0;
|
||||||
$cart['svip_discount'] = 0;
|
$cart['svip_discount'] = 0;
|
||||||
@ -419,6 +416,8 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$cart['coupon_price'] = bcsub($_cartTotalPrice, $cartTotalPrice, 2);
|
$cart['coupon_price'] = bcsub($_cartTotalPrice, $cartTotalPrice, 2);
|
||||||
$cart['true_price'] = $cartTotalPrice;
|
$cart['true_price'] = $cartTotalPrice;
|
||||||
}
|
}
|
||||||
|
$procure = $this->cartByPrice($cart, 1);
|
||||||
|
$procure_price = bcmul($cart['cart_num'], $procure, 2);
|
||||||
unset($cart, $_k);
|
unset($cart, $_k);
|
||||||
$total_true_price = bcadd($_pay_price, $total_true_price, 2);
|
$total_true_price = bcadd($_pay_price, $total_true_price, 2);
|
||||||
if (count($merchantCartList) > 1 || count($merchantCart['list']) > 1) {
|
if (count($merchantCartList) > 1 || count($merchantCart['list']) > 1) {
|
||||||
@ -444,6 +443,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
'delivery_status' => $deliveryStatus,
|
'delivery_status' => $deliveryStatus,
|
||||||
'svip_discount' => $total_svip_discount,
|
'svip_discount' => $total_svip_discount,
|
||||||
'use_svip' => $use_svip,
|
'use_svip' => $use_svip,
|
||||||
|
'procure_price' => $procure_price
|
||||||
];
|
];
|
||||||
$order_total_postage = bcadd($order_total_postage, $postage_price, 2);
|
$order_total_postage = bcadd($order_total_postage, $postage_price, 2);
|
||||||
$order_svip_discount = bcadd($total_svip_discount, $order_svip_discount, 2);
|
$order_svip_discount = bcadd($total_svip_discount, $order_svip_discount, 2);
|
||||||
@ -546,6 +546,8 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$merchantCart['order']['org_price'] = $org_price;
|
$merchantCart['order']['org_price'] = $org_price;
|
||||||
$merchantCart['order']['pay_price'] = $pay_price;
|
$merchantCart['order']['pay_price'] = $pay_price;
|
||||||
$merchantCart['order']['coupon_price'] = $coupon_price;
|
$merchantCart['order']['coupon_price'] = $coupon_price;
|
||||||
|
$merchantCart['order']['postage_price'] = $merchantCart['order']['postage_price'];
|
||||||
|
$merchantCart['order']['procure_price'] = $merchantCart['order']['procure_price'];
|
||||||
|
|
||||||
$order_price = bcadd($order_price, $pay_price, 2);
|
$order_price = bcadd($order_price, $pay_price, 2);
|
||||||
$order_total_price = bcadd($order_total_price, $total_price, 2);
|
$order_total_price = bcadd($order_total_price, $total_price, 2);
|
||||||
@ -802,7 +804,8 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
'mark' => $mark[$merchantCart['mer_id']] ?? '',
|
'mark' => $mark[$merchantCart['mer_id']] ?? '',
|
||||||
'coupon_price' => bcadd($merchantCart['order']['coupon_price'], $merchantCart['order']['platform_coupon_price'], 2),
|
'coupon_price' => bcadd($merchantCart['order']['coupon_price'], $merchantCart['order']['platform_coupon_price'], 2),
|
||||||
'platform_coupon_price' => $merchantCart['order']['platform_coupon_price'],
|
'platform_coupon_price' => $merchantCart['order']['platform_coupon_price'],
|
||||||
'pay_type' => $pay_type
|
'pay_type' => $pay_type,
|
||||||
|
'procure_price' => $merchantCart['order']['procure_price'],
|
||||||
];
|
];
|
||||||
$allUseCoupon = array_merge($allUseCoupon, $merchantCart['order']['useCouponIds']);
|
$allUseCoupon = array_merge($allUseCoupon, $merchantCart['order']['useCouponIds']);
|
||||||
$orderList[] = $_order;
|
$orderList[] = $_order;
|
||||||
|
@ -311,16 +311,12 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
'financial_record_sn' => $financeSn . ($i++)
|
'financial_record_sn' => $financeSn . ($i++)
|
||||||
];
|
];
|
||||||
|
|
||||||
$_payPrice = bcsub($order->pay_price, bcadd($order['extension_one'], $order['extension_two'], 3), 2);
|
if($order->source==103){
|
||||||
if ($presell) {
|
$_payPrice = $order->procure_price;
|
||||||
if (isset($order->orderProduct[0]['cart_info']['presell_extension_one']) && $order->orderProduct[0]['cart_info']['presell_extension_one'] > 0) {
|
//计算手续费
|
||||||
$_payPrice = bcadd($_payPrice, $order->orderProduct[0]['cart_info']['presell_extension_one'], 2);
|
$_order_rate=bcsub($order->pay_price,$_payPrice,2);
|
||||||
}
|
}else{
|
||||||
if (isset($order->orderProduct[0]['cart_info']['presell_extension_two']) && $order->orderProduct[0]['cart_info']['presell_extension_two'] > 0) {
|
$_payPrice = $order->pay_price;
|
||||||
$_payPrice = bcadd($_payPrice, $order->orderProduct[0]['cart_info']['presell_extension_two'], 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$_order_rate = 0;
|
$_order_rate = 0;
|
||||||
|
|
||||||
//平台手续费
|
//平台手续费
|
||||||
@ -332,8 +328,21 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
|
|
||||||
$_payPrice = bcsub($_payPrice, $_order_rate, 2);
|
$_payPrice = bcsub($_payPrice, $_order_rate, 2);
|
||||||
// 结算各镇 小组佣金
|
// 结算各镇 小组佣金
|
||||||
event('order.paySuccessOrder', compact('order', '_order_rate'));
|
// event('order.paySuccessOrder', compact('order', '_order_rate'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// bcsub($order->pay_price, bcadd($order['extension_one'], $order['extension_two'], 3), 2);
|
||||||
|
// if ($presell) {
|
||||||
|
// if (isset($order->orderProduct[0]['cart_info']['presell_extension_one']) && $order->orderProduct[0]['cart_info']['presell_extension_one'] > 0) {
|
||||||
|
// $_payPrice = bcadd($_payPrice, $order->orderProduct[0]['cart_info']['presell_extension_one'], 2);
|
||||||
|
// }
|
||||||
|
// if (isset($order->orderProduct[0]['cart_info']['presell_extension_two']) && $order->orderProduct[0]['cart_info']['presell_extension_two'] > 0) {
|
||||||
|
// $_payPrice = bcadd($_payPrice, $order->orderProduct[0]['cart_info']['presell_extension_two'], 2);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!$presell) {
|
if (!$presell) {
|
||||||
if ($order['commission_rate'] > 0) {
|
if ($order['commission_rate'] > 0) {
|
||||||
@ -371,21 +380,21 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
'financial_record_sn' => $financeSn . ($i++)
|
'financial_record_sn' => $financeSn . ($i++)
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($order->platform_coupon_price > 0) {
|
// if ($order->platform_coupon_price > 0) {
|
||||||
$finance[] = [
|
// $finance[] = [
|
||||||
'order_id' => $order->order_id,
|
// 'order_id' => $order->order_id,
|
||||||
'order_sn' => $order->order_sn,
|
// 'order_sn' => $order->order_sn,
|
||||||
'user_info' => $groupOrder->user->nickname,
|
// 'user_info' => $groupOrder->user->nickname,
|
||||||
'user_id' => $uid,
|
// 'user_id' => $uid,
|
||||||
'financial_type' => $isVipCoupon ? 'order_svip_coupon' : 'order_platform_coupon',
|
// 'financial_type' => $isVipCoupon ? 'order_svip_coupon' : 'order_platform_coupon',
|
||||||
'financial_pm' => 0,
|
// 'financial_pm' => 0,
|
||||||
'type' => 1,
|
// 'type' => 1,
|
||||||
'number' => $order->platform_coupon_price,
|
// 'number' => $order->platform_coupon_price,
|
||||||
'mer_id' => $order->mer_id,
|
// 'mer_id' => $order->mer_id,
|
||||||
'financial_record_sn' => $financeSn . ($i++)
|
// 'financial_record_sn' => $financeSn . ($i++)
|
||||||
];
|
// ];
|
||||||
$_payPrice = bcadd($_payPrice, $order->platform_coupon_price, 2);
|
// $_payPrice = bcadd($_payPrice, $order->platform_coupon_price, 2);
|
||||||
}
|
// }
|
||||||
if (!$is_combine) {
|
if (!$is_combine) {
|
||||||
app()->make(MerchantRepository::class)->addLockMoney($order->mer_id, 'order', $order->order_id, $_payPrice);
|
app()->make(MerchantRepository::class)->addLockMoney($order->mer_id, 'order', $order->order_id, $_payPrice);
|
||||||
}
|
}
|
||||||
@ -576,7 +585,11 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
return $cart['productAttr']['price'];
|
return $cart['productAttr']['price'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if($type==0){
|
||||||
return $cart['productAttr']['price'];
|
return $cart['productAttr']['price'];
|
||||||
|
}else{
|
||||||
|
return $cart['productAttr']['procure_price'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user