From 4e9e6d0410a4931fbbc5171b1f3ca36e4ca91616 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Sat, 8 Jun 2024 17:02:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E8=B0=83=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 2 +- app/common/logic/PayNotifyLogic.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 27c2b2ca..26d0a558 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -159,7 +159,7 @@ class OrderLogic extends BaseLogic ]; $order['default_delivery'] = 0; if($params['store_id']){ - $order['default_delivery'] = SystemStore::where('id',$params['store_id'])->value('default_delivery'); + $order['default_delivery'] = SystemStore::where('id',$params['store_id'])->value('is_store'); } } catch (\Exception $e) { self::setError($e->getMessage()); diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 8d40b16e..55d16916 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -242,8 +242,16 @@ class PayNotifyLogic extends BaseLogic $financeLogic->order = $order; $financeLogic->user = ['uid' => $order['uid']]; if ($order->pay_type != 9 || $order->pay_type != 10) { - $financeLogic->in($transaction_id,$order['pay_price'], OrderEnum::USER_ORDER_PAY); - $financeLogic->out($transaction_id,$order['pay_price'], OrderEnum::MERCHANT_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0); + //手续费 + $fees = bcdiv(bcmul($order->pay_price, '0.02', 2), 1, 2); + $financeLogic->in($transaction_id,$order->pay_price, OrderEnum::USER_ORDER_PAY); //用户单入账 + $financeLogic->in($transaction_id,$fees, OrderEnum::OWN_GET); //手续费入账 + //商户应该获得的钱 每个商品的price-ot_price 利润 + if($order->profit !== "0.00"){ //要测下写入没 + $financeLogic->out($transaction_id,$order->pay_price, OrderEnum::MERCHANT_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0);//商户获得的 + } +// $financeLogic->in($transaction_id,$order['pay_price'], OrderEnum::USER_ORDER_PAY); +// $financeLogic->out($transaction_id,$order['pay_price'], OrderEnum::MERCHANT_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0); $financeLogic->save(); } }