From 77e29185f0ab37c8f6400e24a98c527c92aee117 Mon Sep 17 00:00:00 2001 From: fengxinyhyl Date: Sat, 30 Mar 2024 08:25:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderCreateRepository.php | 15 +++++++++++++++ app/controller/merchant/system/Merchant.php | 3 +++ public/mer.html | 2 +- public/system.html | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index f685522..19da6ea 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -1107,6 +1107,21 @@ class StoreOrderCreateRepository extends StoreOrderRepository } else if (isset($merchantCart['merchantCategory']['commission_rate']) && $merchantCart['merchantCategory']['commission_rate'] > 0) { $rate = bcmul($merchantCart['merchantCategory']['commission_rate'], 100, 4); } + + $totalPrice = $merchantCart['order']['total_price']; + $ratePrice = 0; + foreach ($merchantCart['list'] as $item){ + $itemRate = $rate; + if($item['productAttr']['product']['commission_rate']){ + $itemRate = $item['productAttr']['product']['commission_rate']; + } + $ratePrice += round($item['total_price'] * $itemRate /100, 4); + } + if($ratePrice){ + $rate = round($ratePrice/$totalPrice * 100, 4); + } + Log::info("ratePrice is {$ratePrice} and totalPrice is {$totalPrice} and rate is {$rate}"); + Log::info("=====order_info merchantCart===== ".json_encode($merchantCart)); $user_address = isset($address) ? ($address['province'] . $address['city'] . $address['district'] . $address['street'] . $address['detail']) : ''; //整理订单数据 $_order = [ diff --git a/app/controller/merchant/system/Merchant.php b/app/controller/merchant/system/Merchant.php index fc494d6..620ebce 100644 --- a/app/controller/merchant/system/Merchant.php +++ b/app/controller/merchant/system/Merchant.php @@ -88,6 +88,7 @@ class Merchant extends BaseController 'mini_banner', 'mer_keyword', 'mer_address', + 'mer_pics', 'long', 'lat', ['delivery_way',[2]], @@ -101,6 +102,7 @@ class Merchant extends BaseController 'mer_certificate' => $data['mer_certificate'] ], $this->request->merId()); unset($data['mer_certificate']); + $data['mer_pics'] = implode(',', $data['mer_pics']); foreach ($data['delivery_way'] as $datum) { if ($datum == 1) { @@ -151,6 +153,7 @@ class Merchant extends BaseController $delivery = $repository->get($this->request->merId()) + systemConfig(['tx_map_key']); $data = array_merge($data,$delivery); $data['sys_bases_status'] = systemConfig('sys_bases_status') === '0' ? 0 : 1; + $data['mer_pics'] = explode(',', $data['mer_pics']); $data['assets'] = \app(FinancialRecordRepository::class)->getMerchantStatistics(array('is_mer' => $this->request->merId())); // $user = \app(UserRepository::class)->getUserByMerId($this->request->merId()); diff --git a/public/mer.html b/public/mer.html index 18fdc51..34936e3 100644 --- a/public/mer.html +++ b/public/mer.html @@ -1 +1 @@ -加载中...
\ No newline at end of file +加载中...
\ No newline at end of file diff --git a/public/system.html b/public/system.html index 3e501a9..1350290 100644 --- a/public/system.html +++ b/public/system.html @@ -1,3 +1,3 @@ -加载中...
\ No newline at end of file