|
|
@ -356,14 +356,15 @@ class PaySuccess extends BaseService |
|
|
|
//增加商户支付详情 |
|
|
|
//增加商户支付详情 |
|
|
|
$model = \app\store\model\Merchant::detail($orderInfo['merchant_id']); |
|
|
|
$model = \app\store\model\Merchant::detail($orderInfo['merchant_id']); |
|
|
|
$precent = 1; |
|
|
|
$precent = 1; |
|
|
|
|
|
|
|
|
|
|
|
if ($model['commission_ratio']) { |
|
|
|
if ($model['commission_ratio']) { |
|
|
|
$precent = (1 - $model['commission_ratio'] / 1000); |
|
|
|
$precent = (1 - $model['commission_ratio'] / 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
$orderInfo['pay_price'] = (float)($precent * $orderInfo['pay_price']); |
|
|
|
$precentPrice = $precent * $orderInfo['pay_price']; |
|
|
|
(new merchantPayModel())->addDetail($orderInfo); |
|
|
|
(new merchantPayModel())->addDetail($orderInfo, (float)$precentPrice); |
|
|
|
|
|
|
|
|
|
|
|
//累计商户余额支付金额 |
|
|
|
//累计商户余额支付金额 |
|
|
|
merchantModel::setIncTotal($orderInfo['merchant_id'], (float)$orderInfo['pay_price']); |
|
|
|
merchantModel::setIncTotal($orderInfo['merchant_id'], (float)$precentPrice); |
|
|
|
} |
|
|
|
} |
|
|
|
// 将第三方交易记录更新为已支付状态 |
|
|
|
// 将第三方交易记录更新为已支付状态 |
|
|
|
if (in_array($this->method, [PaymentMethodEnum::WECHAT, PaymentMethodEnum::ALIPAY])) { |
|
|
|
if (in_array($this->method, [PaymentMethodEnum::WECHAT, PaymentMethodEnum::ALIPAY])) { |
|
|
|