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, '.', '') . ' 元';
|
||||
}
|
||||
|
||||
// 填充银行卡或其它常规账户信息,并过滤英文底层键
|
||||
|
||||
@@ -32,16 +32,18 @@ class WalletLog extends Common
|
||||
'score_shop_pay' => '积分商城-积分支付',
|
||||
'order_pay' => '商城订单-积分抵扣',
|
||||
'order_refund' => '订单退款-退还积分',
|
||||
'admin_recharge' => '后台-积分充值',
|
||||
'admin_recharge' => '合约调用',
|
||||
'recharge_gift' => '线上充值-赠送积分'
|
||||
],
|
||||
'money' => [
|
||||
'order_pay' => '商城订单-余额支付',
|
||||
'order_recharge' => '线上充值',
|
||||
'admin_recharge' => '后台-余额充值',
|
||||
'admin_recharge' => '合约调用',
|
||||
'recharge_gift' => '线上充值-赠送余额',
|
||||
'activity_gift' => '活动-赠送余额',
|
||||
'order_refund' => '订单退款-退还余额',
|
||||
'withdraw' => '申请提现',
|
||||
'withdraw_error' => '提现失败-返还余额',
|
||||
'transfer_by_commission' => '服务收益-转入到余额',
|
||||
'reward_income' => '收益分成-入账',
|
||||
'reward_back' => '收益分成-退还',
|
||||
@@ -113,4 +115,15 @@ class WalletLog extends Common
|
||||
$eventMap = $this->getEventMap();
|
||||
return $eventMap[$type][$event] ?? ($eventMap['money'][$event] ?? ($eventMap['commission'][$event] ?? ($event ?: '')));
|
||||
}
|
||||
|
||||
public function getMemoAttr($value, $data)
|
||||
{
|
||||
$event = $data['event'] ?? '';
|
||||
if ($event === 'admin_recharge') {
|
||||
if ($value === '后台管理调整余额' || $value === '后台管理调整积分' || $value === '合约调用') {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
return $value ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户