修复提现金额问题

This commit is contained in:
2024-09-30 10:01:34 +08:00
parent a898024dbc
commit df87e9c00b

View File

@@ -547,30 +547,6 @@ class DivideAccountController extends BaseAdminController
$chargeCpr = $this->getChargeCashPayRecordStatusByOrderNo($orderNo);
$chargeCpr->status = $status;
$chargeCpr->saveOrFail();
if ($status == 2) {
if (empty($chargeCash)) {
throw new Exception('金额不能为空');
}
$account = CashAccount::find()->where([
'user_id' => $chargeCpr->store_id,
'user_type' => $chargeCpr->type
])->one();
// 从冻结金额中减去充值金额,并将结果赋值回冻结金额
$account->frozen_cash = bcsub($account->frozen_cash, bcsub($chargeCash, $chargeCpr->charge_cash, 2), 2);
// 减少账户可用余额
$account->able_cash = bcsub($account->able_cash, $chargeCpr->charge_cash, 2);
$account->saveOrFail();
$platformAccount = CashAccount::find()->where([
'user_id' => 0,
'user_type' => 2
])->one();
$platformAccount->able_cash = bcsub($platformAccount->able_cash, $chargeCpr->charge_cash, 2);
$platformAccount->charge_cash = bcadd($platformAccount->charge_cash, $chargeCpr->charge_cash, 2);
$platformAccount->saveOrFail();
}
}
/**