feat(withdraw): 落地方案B一体化商城余额提现与手续费内扣模式,完善多端打款退款与对账闭环
这个提交包含在:
@@ -18,6 +18,8 @@ class Withdraw extends Common
|
||||
'withdraw_info_hidden',
|
||||
'withdraw_info_display',
|
||||
'is_madow_withdraw',
|
||||
'is_money_withdraw',
|
||||
'real_amount',
|
||||
'withdraw_type_text',
|
||||
'wechat_transfer_state_text',
|
||||
];
|
||||
@@ -105,6 +107,27 @@ class Withdraw extends Common
|
||||
|| (isset($info['提现资产']) && strcasecmp($info['提现资产'], 'dmepa') === 0);
|
||||
}
|
||||
|
||||
public function getIsMoneyWithdrawAttr($value, $data)
|
||||
{
|
||||
$info = $this->withdraw_info ?? ($data['withdraw_info'] ?? null);
|
||||
if (is_string($info)) {
|
||||
$info = json_decode($info, true) ?: [];
|
||||
}
|
||||
if (!is_array($info)) {
|
||||
return false;
|
||||
}
|
||||
return (isset($info['wallet_type']) && $info['wallet_type'] === 'money')
|
||||
|| (isset($info['提现资产']) && $info['提现资产'] === '商城余额');
|
||||
}
|
||||
|
||||
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);
|
||||
return max(0, floatval($real));
|
||||
}
|
||||
|
||||
public function getWithdrawInfoDisplayAttr($value, $data)
|
||||
{
|
||||
$info = $this->withdraw_info ?? ($data['withdraw_info'] ?? null);
|
||||
@@ -118,6 +141,8 @@ class Withdraw extends Common
|
||||
$display = [];
|
||||
$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['提现资产'] === '商城余额');
|
||||
|
||||
if ($isMadow) {
|
||||
$display['提现资产'] = 'DMEPA';
|
||||
@@ -148,6 +173,12 @@ class Withdraw extends Common
|
||||
$valClean = trim(str_replace(['元', ' '], '', (string)$marketValue));
|
||||
$display['换算市值'] = number_format((float)$valClean, 2, '.', '') . ' 元';
|
||||
}
|
||||
} elseif ($isMoney) {
|
||||
$display['提现资产'] = '商城余额';
|
||||
$amount = $data['amount'] ?? ($this->amount ?? 0);
|
||||
$chargeFee = $data['charge_fee'] ?? ($this->charge_fee ?? 0);
|
||||
$real = bcsub((string)$amount, (string)$chargeFee, 2);
|
||||
$display['预计到账'] = number_format(max(0, floatval($real)), 2, '.', '') . ' 元';
|
||||
}
|
||||
|
||||
// 填充银行卡或其它常规账户信息,并过滤英文底层键
|
||||
|
||||
在新工单中引用
屏蔽一个用户