修复平台提现手续费

This commit is contained in:
2024-10-11 10:49:47 +08:00
parent 3802886415
commit fd3e440825

View File

@@ -321,17 +321,19 @@ class EplpayCallbackController extends \yii\web\Controller
$CashAccount->charge_cash = bcadd($CashAccount->charge_cash, $applyOrder->charge_cash, 2);
$CashAccount->saveOrFail();
// 扣除平台账户的金额
$platformAccount = CashAccount::find()->where([
'user_id' => 0,
'user_type' => 2
])->one();
if (!$platformAccount) {
throw new Exception('平台账户不存在');
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->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();