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='商户表';