修复平台提现手续费计算

This commit is contained in:
2024-11-27 14:05:29 +08:00
parent 514c2fc03b
commit 1d6db6a33f

View File

@@ -321,19 +321,18 @@ class EplpayCallbackController extends \yii\web\Controller
$CashAccount->charge_cash = bcadd($CashAccount->charge_cash, $applyOrder->charge_cash, 2);
$CashAccount->saveOrFail();
if ($applyOrder->user_id != 0) {
// 扣除平台账户的金额
$platformAccount = CashAccount::find()->where([
'user_id' => 0,
'user_type' => 2
])->one();
if (!$platformAccount) {
throw new Exception('平台账户不存在');
}
$platformAccount->able_cash = bcsub($platformAccount->able_cash, $chargeCpr->charge_cash, 2);
$platformAccount->charge_cash = bcadd($platformAccount->charge_cash, $chargeCpr->charge_cash, 2);
$platformAccount->saveOrFail();
// 扣除平台账户的金额
$platformAccount = CashAccount::find()->where([
'user_id' => 0,
'user_type' => 2
])->one();
if (!$platformAccount) {
throw new Exception('平台账户不存在');
}
$platformAccount->able_cash = bcsub($platformAccount->able_cash, $chargeCpr->charge_cash, 2);
$platformAccount->charge_cash = bcadd($platformAccount->charge_cash, $chargeCpr->charge_cash, 2);
$platformAccount->saveOrFail();
// 增加流水记录
$fundWater = new FundWater();