fix(withdraw): 修复提现台账导出PHP8兼容性与页面崩溃问题,统一大余额与导出体验
这个提交包含在:
@@ -75,7 +75,7 @@ class Withdraw
|
||||
$withdrawInfo = $this->getAccountInfo($type, $params);
|
||||
$withdrawInfo['wallet_type'] = $walletType;
|
||||
if ($walletType === 'money') {
|
||||
$withdrawInfo['提现资产'] = '商城余额';
|
||||
$withdrawInfo['提现资产'] = '钱包余额';
|
||||
} elseif ($walletType === 'commission') {
|
||||
$withdrawInfo['提现资产'] = '佣金钱包';
|
||||
}
|
||||
@@ -102,7 +102,7 @@ class Withdraw
|
||||
'charge_rate' => $withdraw->charge_rate,
|
||||
'wallet_type' => 'money',
|
||||
], '申请提现扣除余额');
|
||||
$this->handleLog($withdraw, '用户发起商城余额提现申请', $this->user);
|
||||
$this->handleLog($withdraw, '用户发起钱包余额提现申请', $this->user);
|
||||
} else {
|
||||
WalletService::change($this->user, 'commission', -$money, 'withdraw', [
|
||||
'withdraw_id' => $withdraw->id,
|
||||
@@ -419,7 +419,7 @@ class Withdraw
|
||||
|| (isset($info['提现资产']) && strcasecmp($info['提现资产'], 'dmepa') === 0);
|
||||
|
||||
$isMoney = (isset($info['wallet_type']) && $info['wallet_type'] === 'money')
|
||||
|| (isset($info['提现资产']) && $info['提现资产'] === '商城余额');
|
||||
|| (isset($info['提现资产']) && in_array($info['提现资产'], ['钱包余额', '商城余额'], true));
|
||||
|
||||
if ($isMadow) {
|
||||
$madowRefund = $info['madow_amount'] ?? ($info['扣除DMEPA'] ?? ($info['扣除dmepa'] ?? 0));
|
||||
@@ -464,7 +464,7 @@ class Withdraw
|
||||
|
||||
return $this->handleLog($withdraw, '拒绝:' . $refuse_msg . ',已退还提现佣金');
|
||||
} else {
|
||||
// 方案 B 一体化内扣:常规提现默认退回商城可用余额本金
|
||||
// 方案 B 一体化内扣:常规提现默认退回钱包可用余额本金
|
||||
WalletService::change($this->user, 'money', $withdraw->amount, 'withdraw_error', [
|
||||
'withdraw_id' => $withdraw->id,
|
||||
'amount' => $withdraw->amount,
|
||||
@@ -473,7 +473,7 @@ class Withdraw
|
||||
'wallet_type' => 'money',
|
||||
], '提现驳回退还余额');
|
||||
|
||||
return $this->handleLog($withdraw, '拒绝:' . $refuse_msg . ',已退还提现商城余额');
|
||||
return $this->handleLog($withdraw, '拒绝:' . $refuse_msg . ',已退还提现钱包余额');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ class Withdraw
|
||||
|| (isset($info['提现资产']) && strcasecmp($info['提现资产'], 'dmepa') === 0);
|
||||
|
||||
$isMoney = (isset($info['wallet_type']) && $info['wallet_type'] === 'money')
|
||||
|| (isset($info['提现资产']) && $info['提现资产'] === '商城余额');
|
||||
|| (isset($info['提现资产']) && in_array($info['提现资产'], ['钱包余额', '商城余额'], true));
|
||||
|
||||
if ($isMadow) {
|
||||
$madowRefund = $info['madow_amount'] ?? ($info['扣除DMEPA'] ?? ($info['扣除dmepa'] ?? 0));
|
||||
@@ -545,7 +545,7 @@ class Withdraw
|
||||
|
||||
return $this->handleLog($withdraw, '提现失败,已退还提现佣金:' . $refuse_msg);
|
||||
} else {
|
||||
// 方案 B 一体化内扣:常规提现默认退回商城可用余额本金
|
||||
// 方案 B 一体化内扣:常规提现默认退回钱包可用余额本金
|
||||
WalletService::change($this->user, 'money', $withdraw->amount, 'withdraw_error', [
|
||||
'withdraw_id' => $withdraw->id,
|
||||
'amount' => $withdraw->amount,
|
||||
@@ -554,7 +554,7 @@ class Withdraw
|
||||
'wallet_type' => 'money',
|
||||
], '提现失败退还余额');
|
||||
|
||||
return $this->handleLog($withdraw, '提现失败,已退还提现商城余额:' . $refuse_msg);
|
||||
return $this->handleLog($withdraw, '提现失败,已退还提现钱包余额:' . $refuse_msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,7 +778,7 @@ class Withdraw
|
||||
|
||||
if ($walletType === 'money') {
|
||||
if (bccomp((string)($this->user->money ?? 0), (string)$money, 2) < 0) {
|
||||
throw new ShoproException('商城可用余额不足');
|
||||
throw new ShoproException('钱包可用余额不足');
|
||||
}
|
||||
} else {
|
||||
if (bccomp((string)($this->user->commission ?? 0), (string)$money, 2) < 0) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户