From ea3d3133b51ae8ab8aa2f60539676f7208fa1cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=98=89?= <445241500@qq.com> Date: Sat, 1 Jun 2024 10:00:32 +0800 Subject: [PATCH] 1 --- app/api/service/order/PaySuccess.php | 6 ++++++ public/install/data/install_struct.sql | 1 + 2 files changed, 7 insertions(+) diff --git a/app/api/service/order/PaySuccess.php b/app/api/service/order/PaySuccess.php index 16c86142..22e0da2e 100644 --- a/app/api/service/order/PaySuccess.php +++ b/app/api/service/order/PaySuccess.php @@ -354,6 +354,12 @@ class PaySuccess extends BaseService ], ['order_no' => $orderInfo['order_no']]); //增加商户支付详情 + $model = \app\store\model\Merchant::detail($orderInfo['merchant_id']); + $precent = 1; + if ($model['commission_ratio']) { + $precent = (1 - $model['commission_ratio'] / 1000); + } + $orderInfo['pay_price'] = (float)($precent * $orderInfo['pay_price']); (new merchantPayModel())->addDetail($orderInfo); //累计商户余额支付金额 diff --git a/public/install/data/install_struct.sql b/public/install/data/install_struct.sql index 168019e6..029694ee 100644 --- a/public/install/data/install_struct.sql +++ b/public/install/data/install_struct.sql @@ -1746,6 +1746,7 @@ CREATE TABLE `yoshop_merchant` ( `is_select_mechant` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '是否精选商户', `total_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '累计金额', `available_amount` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '可用金额', + `commission_ratio` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '抽佣比例', PRIMARY KEY (`merchant_id`), KEY `store_id` (`store_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='商户表';