From 246541b9d7c995c7dcd4ebfe1509804349bf0a42 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Fri, 26 May 2023 13:22:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=B9=B3=E5=8F=B0=E6=89=8B?= =?UTF-8?q?=E7=BB=AD=E8=B4=B9=E5=88=86=E6=B6=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/listener/paySuccessOrder.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/listener/paySuccessOrder.php b/app/listener/paySuccessOrder.php index 7c8fa643..d65986e1 100644 --- a/app/listener/paySuccessOrder.php +++ b/app/listener/paySuccessOrder.php @@ -35,6 +35,18 @@ class paySuccessOrder } $this->streetId = $merchant['street_id']; + $commission_rate = ($event['order']['commission_rate'] / 100); + //该笔订单平台总手续费 + $this->totalAmount = bcmul((string)$event['order']['total_price'], (string)$commission_rate, 2); + $this->remain = $this->totalAmount; + + //镇团队佣金 + $this->calculate(Merchant::TypeTownServer, 'commission_to_town_rate'); + //村团队佣金 + $this->calculate(Merchant::TypeVillageServer, 'commission_to_village_rate'); + //小组服务团队佣金 + $this->calculate(Merchant::TypeTeamServer, 'commission_to_service_team_rate'); + //订单购物详情表是否有云仓数据 $orderProduct = Db::name('store_order_product') ->where('order_id', $event['order']['order_id']) @@ -43,10 +55,7 @@ class paySuccessOrder ->group('source_id') ->column('source,source_id,sum(product_price) total'); foreach ($orderProduct as $item) { - $commission_rate = ($event['order']['commission_rate'] / 100); - //该笔订单平台总手续费 $this->totalAmount = bcmul((string)$item['total'], (string)$commission_rate, 2); - $this->remain = $this->totalAmount; if ($this->totalAmount <= 0) { continue; } @@ -86,12 +95,6 @@ class paySuccessOrder } } - //镇团队佣金 - $this->calculate(Merchant::TypeTownServer, 'commission_to_town_rate'); - //村团队佣金 - $this->calculate(Merchant::TypeVillageServer, 'commission_to_village_rate'); - //小组服务团队佣金 - $this->calculate(Merchant::TypeTeamServer, 'commission_to_service_team_rate'); //云仓佣金 $this->calculate(Merchant::TypeCloudWarehouse, 'commission_to_cloud_rate');