From 3a7e8e71b7c9ff3fe3f063e5bed3a839a3d35c42 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 20 Jan 2024 15:34:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderRepository.php | 32 +++++++++++++------ crmeb/services/ExcelService.php | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index ddd36ac4..64f527ac 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -331,28 +331,40 @@ class StoreOrderRepository extends BaseRepository //市级供应链 $product_mer_id = Db::name('store_order_product')->where('order_id', $order->order_id)->value('product_mer_id'); if ($product_mer_id) { - //市级供应链押金计算 - if ($_payPrice > 0) { - /** @var MerchantRepository $merchantRepo */ - $merchantRepo = app()->make(MerchantRepository::class); - $merchantRepo->merId = $product_mer_id; - $merchantRepo->forceMargin = false; - [$_payPrice, $a, $increase] = $merchantRepo->autoMargin($_payPrice, $order, $finance, $financeSn, $i++); - } $finance[] = [ 'order_id' => $order->order_id, 'order_sn' => $order->order_sn, 'user_info' => $groupOrder->user->nickname, 'user_id' => $uid, - 'financial_type' => 'supply_chain', + 'financial_type' => 'order', 'financial_pm' => 0, 'type' => 1, 'number' => $_payPrice, 'mer_id' => $product_mer_id, 'financial_record_sn' => $financeSn . (($i++)+1) + ]; + //市级供应链押金计算 + if ($_payPrice > 0) { + /** @var MerchantRepository $merchantRepo */ + $merchantRepo = app()->make(MerchantRepository::class); + $merchantRepo->merId = $product_mer_id; + $merchantRepo->forceMargin = false; + [$_payCityPrice, $finance, $increase] = $merchantRepo->autoMargin($_payPrice, $order, $finance, $financeSn, $i++); + } + $finance[] = [ + 'order_id' => $order->order_id, + 'order_sn' => $order->order_sn, + 'user_info' => $groupOrder->user->nickname, + 'user_id' => $uid, + 'financial_type' => 'order_true', + 'financial_pm' => 0, + 'type' => 1, + 'number' => $_payCityPrice, + 'mer_id' => $product_mer_id, + 'financial_record_sn' => $financeSn . (($i++)+2) ]; if (!$is_combine) { - app()->make(MerchantRepository::class)->addLockMoney($product_mer_id, 'order', $order->order_id, $_payPrice); + app()->make(MerchantRepository::class)->addLockMoney($product_mer_id, 'order', $order->order_id, $_payCityPrice); } } diff --git a/crmeb/services/ExcelService.php b/crmeb/services/ExcelService.php index a8a7b79d..9afd75f2 100644 --- a/crmeb/services/ExcelService.php +++ b/crmeb/services/ExcelService.php @@ -373,7 +373,7 @@ class ExcelService 'first_order_commission' => '首单拉新', ]; $sys_pm_1 = ['first_order_commission','supply_chain','order', 'presell', 'order_charge', 'order_presell', 'presell_charge', 'refund_brokerage_one', 'refund_brokerage_two', 'commission_to_platform']; - $mer_pm_1 = ['order', 'presell', 'refund_brokerage_one', 'refund_brokerage_two', 'mer_presell', + $mer_pm_1 = ['order_true','order', 'presell', 'refund_brokerage_one', 'refund_brokerage_two', 'mer_presell', 'order_platform_coupon', 'commission_to_cloud_warehouse', 'commission_to_entry_merchant', 'commission_to_town', 'commission_to_village', 'commission_to_service_team']; $date_ = $where['date']; unset($where['date']);