feat: 新增提现详情页与撤销微信转账功能
新增分销提现单详情页面及接口,支持查看提现单据完整信息;新增后台撤销转账中提现单功能,前端添加对应操作按钮与交互逻辑;完善提现记录跳转逻辑,支持点击进入详情页,同时新增部署脚本同步线上代码。
这个提交包含在:
@@ -281,6 +281,24 @@ class Withdraw extends Backend
|
||||
}
|
||||
}
|
||||
|
||||
// 单笔精准反馈文案
|
||||
if (count($withdraws) === 1) {
|
||||
$row = $withdraws[0];
|
||||
if ($errors) {
|
||||
$this->error('同步失败:' . $errors[0]);
|
||||
}
|
||||
$latest = Db::name('fc_withdraw')->where('id', $row['id'])->find();
|
||||
$transferStatus = (string)$latest['transfer_status'];
|
||||
$stText = $transferStatus === 'WAIT_USER_CONFIRM' ? '待收款用户确认' : ($transferStatus === 'SUCCESS' ? '已转账成功' : ($transferStatus ?: '处理中'));
|
||||
if ($latest['status'] === 'paid') {
|
||||
$this->success('微信转账已完成,单据已更新为「已成功到账」');
|
||||
} elseif ($latest['status'] === 'failed') {
|
||||
$this->error('微信转账已失败/已撤销:' . ($latest['fail_reason'] ?: '未知原因'));
|
||||
} else {
|
||||
$this->success('已同步微信最新状态:' . $stText . '(微信已受理,需收款人在微信完成确认方可到账)');
|
||||
}
|
||||
}
|
||||
|
||||
$msg = '状态同步完成:';
|
||||
if ($successCount > 0) {
|
||||
$msg .= $successCount . ' 笔已确认到账;';
|
||||
@@ -297,4 +315,33 @@ class Withdraw extends Backend
|
||||
|
||||
$this->success($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销「转账中」的微信转账提现单
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function cancel()
|
||||
{
|
||||
$id = (int)$this->request->post('id', 0);
|
||||
if ($id <= 0) {
|
||||
$this->error('参数错误');
|
||||
}
|
||||
|
||||
$withdraw = Db::name('fc_withdraw')->where('id', $id)->find();
|
||||
if (!$withdraw) {
|
||||
$this->error('提现记录不存在');
|
||||
}
|
||||
if ((string)$withdraw['status'] !== 'paying') {
|
||||
$this->error('只有处于「转账中」的记录方可撤销(当前:' . $withdraw['status'] . ')');
|
||||
}
|
||||
|
||||
try {
|
||||
$state = \app\common\library\WxTransfer::cancel($id);
|
||||
} catch (\Throwable $e) {
|
||||
$this->error('撤销失败:' . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->success('转账已成功撤销,款项额度已自动退回用户可提现余额');
|
||||
}
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户