From 1df5b5e7e29ed029ffaa0461e1606b2556403a95 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Fri, 14 Apr 2023 14:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=89=E6=8B=A9=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E5=AE=9E=E9=99=85=E9=87=91=E9=A2=9D=E4=BB=98=E6=AC=BE?= =?UTF-8?q?=E8=AF=B7=E6=AC=BE=E4=B8=8B=EF=BC=8C=E8=AE=A2=E5=8D=95=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=94=B9=E4=BB=B7=E4=B9=8B=E5=90=8E=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E4=B9=8B=E5=89=8D=E7=9A=84=E5=8D=81=E5=87=A0?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E8=BF=94=E4=BD=A3=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/order/StoreOrderServices.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php index bdd04d39e..3436c8f7f 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -771,6 +771,15 @@ HTML; /** @var StoreOrderCreateServices $createServices */ $createServices = app()->make(StoreOrderCreateServices::class); $data['order_id'] = $createServices->getNewOrderId('cp'); + if (sys_config('user_brokerage_type') == 1) { + $percent = bcdiv((string)$data['pay_price'], (string)$order['pay_price'], 6); + if ($order['one_brokerage'] > 0) { + $data['one_brokerage'] = bcmul((string)$order['one_brokerage'], $percent, 2); + } + if ($order['two_brokerage'] > 0) { + $data['two_brokerage'] = bcmul((string)$order['two_brokerage'], $percent, 2); + } + } /** @var StoreOrderStatusServices $services */ $services = app()->make(StoreOrderStatusServices::class); return $this->transaction(function () use ($id, $data, $services) { @@ -2579,7 +2588,7 @@ HTML; 'is_del' => 0, 'paid' => 1, 'status' => 2, - 'change_type' => ['take_delivery','user_take_delivery'] + 'change_type' => ['take_delivery', 'user_take_delivery'] ], 30); foreach ($orderList as $item) { AutoCommentJob::dispatch([$item['id'], $item['cart_id']]);