fix(withdraw): 修复提现台账导出PHP8兼容性与页面崩溃问题,统一大余额与导出体验

这个提交包含在:
chen
2026-09-21 15:11:58 +08:00
父节点 3bd0954df1
当前提交 dbd0ac5e02
共有 21 个文件被更改,包括 255 次插入 和 165 次删除

查看文件

@@ -188,7 +188,9 @@ class Export
'file_name' => $save_file
];
ob_end_clean();
if (ob_get_level() > 0) {
@ob_end_clean();
}
header('pragma:public');
header("Content-type:application/octet-stream; charset=utf-8; name=" . urlencode($save_file));
header("Content-Disposition:attachment; filename=" . urlencode($save_file)); //attachment新窗口打印inline本窗口打印
@@ -199,6 +201,13 @@ class Export
$writer = new $class_name($spreadsheet);
$writer->save($save_file);
if ($this->config['save_type'] != 'save') {
if (function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
}
exit;
}
return $result;
// 修改为原始内存限制,会影响文件下载,暂时不修改回原来内存

查看文件

@@ -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) {

查看文件

@@ -7,7 +7,7 @@ use app\admin\model\shopro\user\User as UserModel;
use addons\shopro\service\Wallet;
/**
* 历史收益全量结转至商城余额服务
* 历史收益全量结转至钱包余额服务
*/
class WalletMigrationService
{
@@ -94,14 +94,14 @@ class WalletMigrationService
// 1. 扣减佣金钱包
Wallet::change($user, 'commission', -$amount, 'transfer_to_money', [
'batch_migration' => 1,
'reason' => '全量历史收益结转至商城余额',
], '收益结转至商城余额');
'reason' => '全量历史收益结转至钱包余额',
], '收益结转至钱包余额');
// 2. 增加商城余额
// 2. 增加钱包余额
Wallet::change($user, 'money', $amount, 'transfer_by_commission', [
'batch_migration' => 1,
'reason' => '全量历史收益结转至商城余额',
], '收益结转至商城余额');
'reason' => '全量历史收益结转至钱包余额',
], '收益结转至钱包余额');
return $amount;
});