diff --git a/addons/shopro/library/Export.php b/addons/shopro/library/Export.php index 0f7b4ca..f82ef94 100755 --- a/addons/shopro/library/Export.php +++ b/addons/shopro/library/Export.php @@ -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; // 修改为原始内存限制,会影响文件下载,暂时不修改回原来内存 diff --git a/addons/shopro/service/Withdraw.php b/addons/shopro/service/Withdraw.php index 1a96289..8acc2c8 100755 --- a/addons/shopro/service/Withdraw.php +++ b/addons/shopro/service/Withdraw.php @@ -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) { diff --git a/addons/shopro/service/partner/WalletMigrationService.php b/addons/shopro/service/partner/WalletMigrationService.php index 6ed7f9e..d34a71a 100644 --- a/addons/shopro/service/partner/WalletMigrationService.php +++ b/addons/shopro/service/partner/WalletMigrationService.php @@ -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; }); diff --git a/application/admin/controller/shopro/Withdraw.php b/application/admin/controller/shopro/Withdraw.php index eedb2ea..ea435f9 100644 --- a/application/admin/controller/shopro/Withdraw.php +++ b/application/admin/controller/shopro/Withdraw.php @@ -72,112 +72,109 @@ class Withdraw extends Common 'updatetime' => '操作时间', ]; - $total = $this->model->sheepFilter()->count(); - if ($total <= 0) { - $this->error('导出数据为空'); + try { + $total = (new WithdrawModel)->sheepFilter()->count(); + if ($total <= 0) { + $this->error('导出数据为空'); + } + + $export = new \addons\shopro\library\Export(); + $params = [ + 'file_name' => '提现管理台账', + 'cell_titles' => $cellTitles, + 'total' => $total, + 'is_sub_cell' => false, + ]; + + $totalAmount = 0; + $totalPaidFee = 0; + $totalChargeFee = 0; + + $result = $export->export($params, function ($pages) use (&$totalAmount, &$totalPaidFee, &$totalChargeFee, $total) { + $datas = (new WithdrawModel)->sheepFilter()->with(['user']) + ->limit((($pages['page'] - 1) * $pages['list_rows']), $pages['list_rows']) + ->select(); + + $newDatas = []; + foreach ($datas as $withdraw) { + $user = $withdraw['user'] ?? null; + $displayInfo = $withdraw['withdraw_info_display'] ?? ($withdraw['withdraw_info'] ?? []); + + // 收款账户信息 + $payeeName = $displayInfo['真实姓名'] ?? ($displayInfo['姓名'] ?? ($displayInfo['微信用户'] ?? '')); + $bankName = $displayInfo['开户行'] ?? ($displayInfo['开户银行'] ?? ''); + $cardNo = $displayInfo['银行卡号'] ?? ($displayInfo['卡号'] ?? ($displayInfo['支付宝账户'] ?? ($displayInfo['支付宝账号'] ?? ($displayInfo['微信ID'] ?? '')))); + if ($cardNo !== '') { + $cardNo = "\t" . $cardNo; + } + + // 提现资产类型 + $assetType = !empty($withdraw['is_madow_withdraw']) ? 'DMEPA' : (!empty($withdraw['is_money_withdraw']) ? '钱包余额' : ($displayInfo['提现资产'] ?? '钱包余额')); + + // 资产折算明细 + $assetDetailParts = []; + if (!empty($displayInfo['扣除DMEPA'])) { + $assetDetailParts[] = '扣除: ' . $displayInfo['扣除DMEPA']; + } + if (!empty($displayInfo['市值汇率'])) { + $assetDetailParts[] = $displayInfo['市值汇率']; + } + if (!empty($displayInfo['换算市值'])) { + $assetDetailParts[] = '市值: ' . $displayInfo['换算市值']; + } + $assetDetail = implode('; ', $assetDetailParts); + + $amount = floatval($withdraw['amount'] ?? 0); + $paidFee = floatval($withdraw['paid_fee'] ?? 0) > 0 ? floatval($withdraw['paid_fee']) : floatval($withdraw['real_amount'] ?? $amount); + $chargeFee = floatval($withdraw['charge_fee'] ?? 0); + + $totalAmount = function_exists('bcadd') ? bcadd((string)$totalAmount, (string)$amount, 2) : ($totalAmount + $amount); + $totalPaidFee = function_exists('bcadd') ? bcadd((string)$totalPaidFee, (string)$paidFee, 2) : ($totalPaidFee + $paidFee); + $totalChargeFee = function_exists('bcadd') ? bcadd((string)$totalChargeFee, (string)$chargeFee, 2) : ($totalChargeFee + $chargeFee); + + $createTime = is_numeric($withdraw['createtime'] ?? null) && intval($withdraw['createtime']) > 0 + ? date('Y-m-d H:i:s', intval($withdraw['createtime'])) + : ($withdraw['createtime'] ?: '-'); + $updateTime = is_numeric($withdraw['updatetime'] ?? null) && intval($withdraw['updatetime']) > 0 + ? date('Y-m-d H:i:s', intval($withdraw['updatetime'])) + : ($withdraw['updatetime'] ?: '-'); + + $newDatas[] = [ + 'id' => $withdraw['id'], + 'withdraw_sn' => "\t" . (string)($withdraw['withdraw_sn'] ?? ''), + 'user_nickname' => $user['nickname'] ?? ('用户 ' . $withdraw['user_id']), + 'user_mobile' => "\t" . (string)($user['mobile'] ?? ''), + 'asset_type' => $assetType, + 'amount' => number_format($amount, 2, '.', ''), + 'paid_fee' => number_format($paidFee, 2, '.', ''), + 'charge_rate_format' => $withdraw['charge_rate_format'] ?? '0.0%', + 'charge_fee' => number_format($chargeFee, 2, '.', ''), + 'withdraw_type_text' => $withdraw['withdraw_type_text'] ?? '-', + 'payee_name' => $payeeName ?: '-', + 'bank_name' => $bankName ?: '-', + 'card_no' => $cardNo ?: '-', + 'asset_detail' => $assetDetail ?: '-', + 'status_text' => $withdraw['status_text'] ?? '-', + 'createtime' => $createTime, + 'updatetime' => $updateTime, + ]; + } + + if ($pages['is_last_page']) { + $newDatas[] = [ + 'id' => '合计: 共 ' . $total . ' 条记录;提现总额:¥' . number_format((float)$totalAmount, 2, '.', '') . ';实际到账总额:¥' . number_format((float)$totalPaidFee, 2, '.', '') . ';手续费总额:¥' . number_format((float)$totalChargeFee, 2, '.', '') + ]; + } + + return $newDatas; + }); + + $this->success('导出成功' . (isset($result['file_path']) && $result['file_path'] ? ',请在服务器: “' . $result['file_path'] . '” 查看' : ''), null, $result); + } catch (HttpResponseException $e) { + throw $e; + } catch (\Throwable $e) { + $this->error('导出处理失败: ' . $e->getMessage()); } - - $export = new \addons\shopro\library\Export(); - $params = [ - 'file_name' => '提现管理台账', - 'cell_titles' => $cellTitles, - 'total' => $total, - 'is_sub_cell' => false, - ]; - - $totalAmount = 0; - $totalPaidFee = 0; - $totalChargeFee = 0; - - $result = $export->export($params, function ($pages) use (&$totalAmount, &$totalPaidFee, &$totalChargeFee, $total) { - $datas = $this->model->sheepFilter()->with(['user']) - ->limit((($pages['page'] - 1) * $pages['list_rows']), $pages['list_rows']) - ->select(); - - $newDatas = []; - foreach ($datas as $withdraw) { - $user = $withdraw['user'] ?? null; - $displayInfo = $withdraw['withdraw_info_display'] ?? ($withdraw['withdraw_info'] ?? []); - - // 收款账户信息 - $payeeName = $displayInfo['真实姓名'] ?? ($displayInfo['姓名'] ?? ($displayInfo['微信用户'] ?? '')); - $bankName = $displayInfo['开户行'] ?? ($displayInfo['开户银行'] ?? ''); - $cardNo = $displayInfo['银行卡号'] ?? ($displayInfo['卡号'] ?? ($displayInfo['支付宝账户'] ?? ($displayInfo['支付宝账号'] ?? ($displayInfo['微信ID'] ?? '')))); - if ($cardNo !== '') { - $cardNo = "\t" . $cardNo; - } - - // 提现资产类型 - $assetType = $withdraw['is_madow_withdraw'] ? 'DMEPA' : ($withdraw['is_money_withdraw'] ? '商城余额' : ($displayInfo['提现资产'] ?? '商城余额')); - - // 资产折算明细 - $assetDetailParts = []; - if (!empty($displayInfo['扣除DMEPA'])) { - $assetDetailParts[] = '扣除: ' . $displayInfo['扣除DMEPA']; - } - if (!empty($displayInfo['市值汇率'])) { - $assetDetailParts[] = $displayInfo['市值汇率']; - } - if (!empty($displayInfo['换算市值'])) { - $assetDetailParts[] = '市值: ' . $displayInfo['换算市值']; - } - $assetDetail = implode('; ', $assetDetailParts); - - $amount = floatval($withdraw['amount'] ?? 0); - $paidFee = floatval($withdraw['paid_fee'] ?? 0) > 0 ? floatval($withdraw['paid_fee']) : floatval($withdraw['real_amount'] ?? $amount); - $chargeFee = floatval($withdraw['charge_fee'] ?? 0); - - $totalAmount = function_exists('bcadd') ? bcadd((string)$totalAmount, (string)$amount, 2) : ($totalAmount + $amount); - $totalPaidFee = function_exists('bcadd') ? bcadd((string)$totalPaidFee, (string)$paidFee, 2) : ($totalPaidFee + $paidFee); - $totalChargeFee = function_exists('bcadd') ? bcadd((string)$totalChargeFee, (string)$chargeFee, 2) : ($totalChargeFee + $chargeFee); - - $newDatas[] = [ - 'id' => $withdraw['id'], - 'withdraw_sn' => "\t" . (string)($withdraw['withdraw_sn'] ?? ''), - 'user_nickname' => $user['nickname'] ?? ('用户 ' . $withdraw['user_id']), - 'user_mobile' => "\t" . (string)($user['mobile'] ?? ''), - 'asset_type' => $assetType, - 'amount' => number_format($amount, 2, '.', ''), - 'paid_fee' => number_format($paidFee, 2, '.', ''), - 'charge_rate_format' => $withdraw['charge_rate_format'] ?? '0.0%', - 'charge_fee' => number_format($chargeFee, 2, '.', ''), - 'withdraw_type_text' => $withdraw['withdraw_type_text'] ?? '-', - 'payee_name' => $payeeName ?: '-', - 'bank_name' => $bankName ?: '-', - 'card_no' => $cardNo ?: '-', - 'asset_detail' => $assetDetail ?: '-', - 'status_text' => $withdraw['status_text'] ?? '-', - 'createtime' => $withdraw['createtime'] ?? '-', - 'updatetime' => $withdraw['updatetime'] ?? '-', - ]; - } - - if ($pages['is_last_page']) { - $newDatas[] = [ - 'id' => '合计: 共 ' . $total . ' 条记录', - 'withdraw_sn' => '', - 'user_nickname' => '', - 'user_mobile' => '', - 'asset_type' => '', - 'amount' => number_format((float)$totalAmount, 2, '.', ''), - 'paid_fee' => number_format((float)$totalPaidFee, 2, '.', ''), - 'charge_rate_format' => '', - 'charge_fee' => number_format((float)$totalChargeFee, 2, '.', ''), - 'withdraw_type_text' => '', - 'payee_name' => '', - 'bank_name' => '', - 'card_no' => '', - 'asset_detail' => '', - 'status_text' => '', - 'createtime' => '', - 'updatetime' => '', - ]; - } - - return $newDatas; - }); - - return $result; } diff --git a/application/admin/controller/shopro/order/Order.php b/application/admin/controller/shopro/order/Order.php index e503384..9bb43f8 100644 --- a/application/admin/controller/shopro/order/Order.php +++ b/application/admin/controller/shopro/order/Order.php @@ -275,7 +275,7 @@ class Order extends Common 'formula' => (string) ($row->formula ?? ''), 'skip_reason_text' => (string) ($row->skip_reason_text ?? ''), 'wallet_type' => (string) ($row->wallet_type ?? ($amount > 0 ? \addons\shopro\service\partner\PartnerConfig::rewardWalletType() : 'system')), - 'wallet_type_text' => (string) ($row->wallet_type_text ?: ($amount > 0 ? (\addons\shopro\service\partner\PartnerConfig::rewardWalletType() === 'money' ? '商城余额' : '佣金钱包') : '平台留存')), + 'wallet_type_text' => (string) ($row->wallet_type_text ?: ($amount > 0 ? (\addons\shopro\service\partner\PartnerConfig::rewardWalletType() === 'money' ? '钱包余额' : '佣金钱包') : '平台留存')), ]; } @@ -385,7 +385,7 @@ class Order extends Common 'unit' => '元', 'order_contrib' => $venueRuleContrib, 'wallet_type' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType(), - 'wallet_type_text' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType() === 'money' ? '商城余额' : '佣金钱包', + 'wallet_type_text' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType() === 'money' ? '钱包余额' : '佣金钱包', 'settled_key' => 'venue_settled', 'default_user_count' => $activeVenueCount, ], @@ -396,7 +396,7 @@ class Order extends Common 'unit' => '元', 'order_contrib' => $countyRuleContrib, 'wallet_type' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType(), - 'wallet_type_text' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType() === 'money' ? '商城余额' : '佣金钱包', + 'wallet_type_text' => \addons\shopro\service\partner\PartnerConfig::rewardWalletType() === 'money' ? '钱包余额' : '佣金钱包', 'settled_key' => 'county_settled', 'default_user_count' => $activeCountyCount, ], @@ -586,7 +586,7 @@ class Order extends Common return [ 'items' => $items, - 'total_cash' => number_format($totalInstantCash, 2, '.', ''), // 直入商城余额的即时现金 + 'total_cash' => number_format($totalInstantCash, 2, '.', ''), // 直入钱包余额的即时现金 'total_instant_cash' => number_format($totalInstantCash, 2, '.', ''), 'total_share_cash' => number_format($totalShareCash, 2, '.', ''), 'total_all_cash' => number_format($totalAllCash, 2, '.', ''), diff --git a/application/admin/controller/shopro/partner/Reward.php b/application/admin/controller/shopro/partner/Reward.php index 3a5bebe..2255101 100644 --- a/application/admin/controller/shopro/partner/Reward.php +++ b/application/admin/controller/shopro/partner/Reward.php @@ -84,7 +84,7 @@ class Reward extends Common 'reward_type_text' => $reward['reward_type_text'], 'role_text' => $reward['role_text'] ?? $reward['role'], 'amount' => $reward['amount'], - 'wallet_type_text' => $reward['wallet_type_text'] ?? '商城余额', + 'wallet_type_text' => $reward['wallet_type_text'] ?? '钱包余额', 'madow' => \addons\shopro\service\partner\IdentityService::formatMadow($reward['madow']), 'base_amount' => $reward['base_amount'], 'status_text' => $reward['status_text'], @@ -282,7 +282,7 @@ class Reward extends Common } /** - * 执行全量结转收益至商城余额 + * 执行全量结转收益至钱包余额 */ public function transferAllCommission() { diff --git a/application/admin/model/shopro/Withdraw.php b/application/admin/model/shopro/Withdraw.php index 25a0e4f..35402f6 100644 --- a/application/admin/model/shopro/Withdraw.php +++ b/application/admin/model/shopro/Withdraw.php @@ -89,9 +89,10 @@ class Withdraw extends Common public function getChargeRateFormatAttr($value, $data) { - $value = $value ?: ($data['charge_rate'] ?? null); + $rate = $value !== null && $value !== '' ? $value : ($data['charge_rate'] ?? 0); + $rate = is_numeric($rate) ? (string)$rate : '0'; - return bcmul((string)$value, '100', 1) . '%'; + return function_exists('bcmul') ? (bcmul($rate, '100', 1) . '%') : (round(floatval($rate) * 100, 1) . '%'); } public function getIsMadowWithdrawAttr($value, $data) @@ -117,14 +118,16 @@ class Withdraw extends Common return false; } return (isset($info['wallet_type']) && $info['wallet_type'] === 'money') - || (isset($info['提现资产']) && $info['提现资产'] === '商城余额'); + || (isset($info['提现资产']) && in_array($info['提现资产'], ['钱包余额', '商城余额'], true)); } public function getRealAmountAttr($value, $data) { - $amount = $data['amount'] ?? ($this->amount ?? 0); - $chargeFee = $data['charge_fee'] ?? ($this->charge_fee ?? 0); - $real = bcsub((string)$amount, (string)$chargeFee, 2); + $amount = isset($data['amount']) && is_numeric($data['amount']) ? (string)$data['amount'] : (string)($this->amount ?? '0'); + $chargeFee = isset($data['charge_fee']) && is_numeric($data['charge_fee']) ? (string)$data['charge_fee'] : (string)($this->charge_fee ?? '0'); + $amount = is_numeric($amount) ? $amount : '0'; + $chargeFee = is_numeric($chargeFee) ? $chargeFee : '0'; + $real = function_exists('bcsub') ? bcsub($amount, $chargeFee, 2) : number_format(floatval($amount) - floatval($chargeFee), 2, '.', ''); return max(0, floatval($real)); } @@ -142,7 +145,7 @@ class Withdraw extends Common $isMadow = (isset($info['wallet_type']) && $info['wallet_type'] === 'madow') || (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) { $display['提现资产'] = 'DMEPA'; @@ -177,18 +180,23 @@ class Withdraw extends Common // 手续费与预计到账 $chargeFee = $data['charge_fee'] ?? ($this->charge_fee ?? ($info['charge_fee'] ?? 0)); $chargeRate = $data['charge_rate'] ?? ($this->charge_rate ?? ($info['charge_rate'] ?? 0)); + $chargeFee = is_numeric($chargeFee) ? (string)$chargeFee : '0'; + $chargeRate = is_numeric($chargeRate) ? (string)$chargeRate : '0'; if (floatval($chargeFee) > 0 || floatval($chargeRate) > 0) { - $ratePercent = bcmul((string)$chargeRate, '100', 1); + $ratePercent = function_exists('bcmul') ? bcmul($chargeRate, '100', 1) : round(floatval($chargeRate) * 100, 1); $display['提现手续费'] = number_format(floatval($chargeFee), 2, '.', '') . ' 元 (' . $ratePercent . '%)'; } $amount = $data['amount'] ?? ($this->amount ?? 0); - $real = bcsub((string)$amount, (string)$chargeFee, 2); + $amount = is_numeric($amount) ? (string)$amount : '0'; + $real = function_exists('bcsub') ? bcsub($amount, $chargeFee, 2) : number_format(floatval($amount) - floatval($chargeFee), 2, '.', ''); $display['预计到账'] = number_format(max(0, floatval($real)), 2, '.', '') . ' 元'; } elseif ($isMoney) { - $display['提现资产'] = '商城余额'; + $display['提现资产'] = '钱包余额'; $amount = $data['amount'] ?? ($this->amount ?? 0); $chargeFee = $data['charge_fee'] ?? ($this->charge_fee ?? 0); - $real = bcsub((string)$amount, (string)$chargeFee, 2); + $amount = is_numeric($amount) ? (string)$amount : '0'; + $chargeFee = is_numeric($chargeFee) ? (string)$chargeFee : '0'; + $real = function_exists('bcsub') ? bcsub($amount, $chargeFee, 2) : number_format(floatval($amount) - floatval($chargeFee), 2, '.', ''); $display['预计到账'] = number_format(max(0, floatval($real)), 2, '.', '') . ' 元'; } diff --git a/application/admin/model/shopro/partner/Reward.php b/application/admin/model/shopro/partner/Reward.php index 45a9f36..006038c 100644 --- a/application/admin/model/shopro/partner/Reward.php +++ b/application/admin/model/shopro/partner/Reward.php @@ -119,13 +119,13 @@ class Reward extends Common { $type = $this->getWalletTypeAttr(null, $data); $map = [ - 'money' => '商城余额', + 'money' => '钱包余额', 'commission' => '佣金钱包', 'voucher' => '消费补贴券', 'madow' => '分红dmepa', 'system' => '平台留存', ]; - return $map[$type] ?? '商城余额'; + return $map[$type] ?? '钱包余额'; } public function buyer() diff --git a/application/admin/view/shopro/commission/agent/detail.html b/application/admin/view/shopro/commission/agent/detail.html index 2395a52..26dd8d9 100644 --- a/application/admin/view/shopro/commission/agent/detail.html +++ b/application/admin/view/shopro/commission/agent/detail.html @@ -385,7 +385,7 @@ {{ state.data.total_income || state.data.income_total_cash || '0.00' }} 元 - 直入商城余额 + 直入钱包余额 -
商城可用余额:
+
钱包可用余额:
{{ state.data.user?.money || state.data.user_money || '0.00' }} 元 diff --git a/application/admin/view/shopro/commission/reward/index.html b/application/admin/view/shopro/commission/reward/index.html index 411086b..e842a0d 100644 --- a/application/admin/view/shopro/commission/reward/index.html +++ b/application/admin/view/shopro/commission/reward/index.html @@ -6,7 +6,7 @@
历史佣金
- 注:当前收益分成已全额直入商城余额,历史未转佣金可批量转入余额 + 注:当前收益分成已全额直入钱包余额,历史未转佣金可批量转入余额
diff --git a/application/admin/view/shopro/order/order/detail.html b/application/admin/view/shopro/order/order/detail.html index df785b9..fe8b5b3 100644 --- a/application/admin/view/shopro/order/order/detail.html +++ b/application/admin/view/shopro/order/order/detail.html @@ -887,7 +887,7 @@
即时现金分成 ¥{{ state.detail.partner_split.total_instant_cash || state.detail.partner_split.total_cash }} - 直入商城余额 + 直入钱包余额 均分奖池现金贡献 ¥{{ state.detail.partner_split.total_share_cash }} @@ -965,7 +965,7 @@ size="small" :type="scope.row.wallet_type === 'money' ? 'success' : (scope.row.wallet_type === 'commission' ? 'warning' : (scope.row.wallet_type === 'madow' ? 'primary' : 'info'))" > - {{ scope.row.wallet_type_text || (Number(scope.row.amount) > 0 ? '商城余额' : (Number(scope.row.madow) > 0 ? '分红dmepa' : '平台留存')) }} + {{ scope.row.wallet_type_text || (Number(scope.row.amount) > 0 ? '钱包余额' : (Number(scope.row.madow) > 0 ? '分红dmepa' : '平台留存')) }} diff --git a/application/admin/view/shopro/partner/reward/index.html b/application/admin/view/shopro/partner/reward/index.html index 0ca4b0d..ede922f 100644 --- a/application/admin/view/shopro/partner/reward/index.html +++ b/application/admin/view/shopro/partner/reward/index.html @@ -58,7 +58,7 @@ size="small" :type="scope.row.wallet_type === 'money' ? 'success' : (scope.row.wallet_type === 'madow' ? 'primary' : (scope.row.wallet_type === 'commission' ? 'warning' : 'info'))" > - {{ scope.row.wallet_type_text || (Number(scope.row.amount) > 0 ? '商城余额' : (Number(scope.row.madow) > 0 ? '分红dmepa' : '消费补贴')) }} + {{ scope.row.wallet_type_text || (Number(scope.row.amount) > 0 ? '钱包余额' : (Number(scope.row.madow) > 0 ? '分红dmepa' : '消费补贴')) }} @@ -177,7 +177,7 @@ size="small" :type="scope.row.wallet_type === 'money' ? 'success' : (scope.row.wallet_type === 'madow' ? 'primary' : 'info')" > - {{ scope.row.wallet_type_text || '商城余额' }} + {{ scope.row.wallet_type_text || '钱包余额' }} diff --git a/application/admin/view/shopro/user/user/detail.html b/application/admin/view/shopro/user/user/detail.html index 6b7d5e0..530c7fe 100644 --- a/application/admin/view/shopro/user/user/detail.html +++ b/application/admin/view/shopro/user/user/detail.html @@ -426,7 +426,7 @@ ¥{{ state.detail.total_income || state.detail.income_total_cash || '0.00' }}
- 当前商城余额: ¥{{ state.detail.money || '0.00' }} + 当前钱包余额: ¥{{ state.detail.money || '0.00' }}
历史未转佣金: ¥{{ state.detail.commission || '0.00' }} @@ -480,7 +480,7 @@
- 商城余额 / 积分 + 钱包余额 / 积分 {if $auth->check('shopro/user/user/recharge')}
充余额 @@ -544,7 +544,7 @@ @@ -665,7 +665,7 @@ diff --git a/application/admin/view/shopro/user/user/index.html b/application/admin/view/shopro/user/user/index.html index 5acd2e3..6dc1067 100644 --- a/application/admin/view/shopro/user/user/index.html +++ b/application/admin/view/shopro/user/user/index.html @@ -152,7 +152,7 @@ diff --git a/application/admin/view/shopro/user/user/recharge.html b/application/admin/view/shopro/user/user/recharge.html index 1cc0c52..c50eade 100644 --- a/application/admin/view/shopro/user/user/recharge.html +++ b/application/admin/view/shopro/user/user/recharge.html @@ -22,7 +22,7 @@
-
商城余额
+
钱包余额
¥{{ state.user.money || '0.00' }}
diff --git a/application/admin/view/shopro/withdraw/index.html b/application/admin/view/shopro/withdraw/index.html index 5333071..1a5cfc4 100644 --- a/application/admin/view/shopro/withdraw/index.html +++ b/application/admin/view/shopro/withdraw/index.html @@ -66,7 +66,7 @@