```
feat(split-order): 添加分账订单失败原因详情展示功能 - 新增 fail_reason_full 字段用于存储完整的失败原因信息 - 实现 formatFailReasonFull 方法解析微信分账失败的详细信息 - 优化前端表格展示,增加查看完整失败原因的弹窗功能 - 调整表格列宽度和样式,提升买家信息展示效果 - 修复昵称和角色ID显示逻辑,避免重复显示问题 ```
这个提交包含在:
@@ -147,6 +147,7 @@ class Order extends Base
|
||||
$data['receiver_preview'] = $receiverPreview;
|
||||
$data['receiver_summary'] = $summaryLines ? implode(';', $summaryLines) : '—';
|
||||
$data['fail_reason'] = $this->formatFailReason($data['wx_result'] ?? '', $status);
|
||||
$data['fail_reason_full'] = $this->formatFailReasonFull($data['wx_result'] ?? '', $status);
|
||||
|
||||
$diag = (new SplitCalculator())->diagnose($orderId);
|
||||
$data['split_source'] = $diag['final_source'];
|
||||
@@ -264,8 +265,8 @@ class Order extends Base
|
||||
$mobile = is_array($user) ? trim((string) ($user['mobile'] ?? '')) : '';
|
||||
if ($nickname !== '') {
|
||||
$label = $nickname;
|
||||
if ($roleId > 0) {
|
||||
$label .= '#' . $roleId;
|
||||
if ($roleId > 0 && (string) $nickname !== (string) $roleId) {
|
||||
$label .= ' #' . $roleId;
|
||||
}
|
||||
if ($mobile !== '') {
|
||||
$label .= ' ' . $this->maskMobile($mobile);
|
||||
@@ -326,7 +327,38 @@ class Order extends Base
|
||||
return implode(' ', $parts);
|
||||
}
|
||||
}
|
||||
return mb_strlen($raw) > 120 ? (mb_substr($raw, 0, 120) . '…') : $raw;
|
||||
$full = $this->formatFailReasonFull($wxResult, $status);
|
||||
if ($full === '') {
|
||||
return '';
|
||||
}
|
||||
return mb_strlen($full) > 48 ? (mb_substr($full, 0, 48) . '…') : $full;
|
||||
}
|
||||
|
||||
protected function formatFailReasonFull($wxResult, $status)
|
||||
{
|
||||
if ($status !== 4 || $wxResult === '' || $wxResult === null) {
|
||||
return '';
|
||||
}
|
||||
$raw = is_string($wxResult) ? $wxResult : json_encode($wxResult, JSON_UNESCAPED_UNICODE);
|
||||
if ($raw === '') {
|
||||
return '';
|
||||
}
|
||||
if (strpos($raw, 'fund_freeze_stat=FREEZE') !== false) {
|
||||
return '微信资金冻结,需发货/确认收货后再分账';
|
||||
}
|
||||
$decoded = json_decode($raw, true);
|
||||
if (is_array($decoded)) {
|
||||
$parts = array_filter([
|
||||
$decoded['resp_desc'] ?? '',
|
||||
isset($decoded['resp_code']) ? ('resp_code=' . $decoded['resp_code']) : '',
|
||||
$decoded['bank_message'] ?? '',
|
||||
$decoded['trans_stat'] ?? '',
|
||||
]);
|
||||
if ($parts) {
|
||||
return implode(',', $parts);
|
||||
}
|
||||
}
|
||||
return $raw;
|
||||
}
|
||||
|
||||
protected function formatBuyerDisplay($nickname, $mobile, $userId)
|
||||
|
||||
在新工单中引用
屏蔽一个用户