From 8d97769ea81e9ec99f3921a3753b08e8395dc1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AF=E4=B9=90=E5=8A=A0=E5=86=B0?= <11869599+addie66@user.noreply.gitee.com> Date: Wed, 30 Sep 2026 14:57:14 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(shopro=5Fhuifu):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=95=86=E6=88=B7=E5=85=A5=E9=A9=BB=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为HuifuOnboardQuery类的pollAndUpdate方法添加详细的错误日志记录, 包括开始轮询、跳过条件判断、申请状态查询和基础信息查询等关键步骤的日志输出, 便于调试和监控商户入驻流程的状态变化。 同时为applyRemoteStatus和isBasicActive方法增加日志记录, 帮助追踪远程状态解析结果和基础状态激活检查的过程。 ``` --- .../library/onboard/HuifuOnboardQuery.php | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/addons/shopro_huifu/library/onboard/HuifuOnboardQuery.php b/addons/shopro_huifu/library/onboard/HuifuOnboardQuery.php index a474638..8bc83e1 100644 --- a/addons/shopro_huifu/library/onboard/HuifuOnboardQuery.php +++ b/addons/shopro_huifu/library/onboard/HuifuOnboardQuery.php @@ -16,23 +16,39 @@ class HuifuOnboardQuery public function pollAndUpdate(Onboard $row) { + \think\Log::error('[shopro_huifu] onboard poll begin file=' . realpath(__FILE__) + . ' id=' . $row['id'] + . ' huifu_id=' . ($row['huifu_id'] ?? '') + . ' apply_no=' . ($row['apply_no'] ?? '') + . ' busi_req_seq_id=' . ($row['busi_req_seq_id'] ?? '') + . ' status=' . ($row['onboard_status'] ?? '')); + if (!$row['huifu_id']) { + \think\Log::error('[shopro_huifu] onboard poll skipped: missing huifu_id id=' . $row['id']); return $row; } if ($row['onboard_status'] === Onboard::STATUS_APPROVED) { + \think\Log::error('[shopro_huifu] onboard poll skipped: already approved id=' . $row['id']); return $row; } $applyNo = $row['apply_no']; if ($applyNo) { $status = $this->queryApply($row['huifu_id'], $applyNo); + \think\Log::error('[shopro_huifu] onboard apply query id=' . $row['id'] + . ' apply_no=' . $applyNo + . ' data=' . json_encode($status, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); $row = $this->applyRemoteStatus($row, $status); if ($row['onboard_status'] === Onboard::STATUS_APPROVED) { return $row; } + } else { + \think\Log::error('[shopro_huifu] onboard apply query skipped: empty apply_no id=' . $row['id']); } $basic = $this->queryBasic($row['huifu_id']); + \think\Log::error('[shopro_huifu] onboard basic query id=' . $row['id'] + . ' data=' . json_encode($basic, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); if ($this->isBasicActive($basic)) { if (in_array($row['onboard_status'], [Onboard::STATUS_BUSI_PENDING, Onboard::STATUS_BASIC_OK], true)) { $row->onboard_status = Onboard::STATUS_APPROVED; @@ -76,11 +92,17 @@ class HuifuOnboardQuery protected function applyRemoteStatus(Onboard $row, array $data) { if (!$data) { + \think\Log::error('[shopro_huifu] onboard remote status empty id=' . $row['id']); return $row; } $stat = strtolower((string) ($data['apply_status'] ?? $data['audit_status'] ?? $data['status'] ?? '')); $desc = (string) ($data['apply_desc'] ?? $data['resp_desc'] ?? $data['reject_reason'] ?? ''); + \think\Log::error('[shopro_huifu] onboard remote status parsed id=' . $row['id'] + . ' stat=' . $stat + . ' desc=' . $desc + . ' keys=' . implode(',', array_keys($data))); + if (in_array($stat, ['s', 'success', 'approved', '1', '02', '2'], true)) { $row->onboard_status = Onboard::STATUS_APPROVED; $row->reject_reason = ''; @@ -106,9 +128,14 @@ class HuifuOnboardQuery protected function isBasicActive(array $data) { if (!$data) { + \think\Log::error('[shopro_huifu] onboard basic active check: empty response'); return false; } $stat = strtolower((string) ($data['user_status'] ?? $data['status'] ?? $data['acct_stat'] ?? '')); - return in_array($stat, ['n', 'normal', 's', 'success', '1'], true); + $active = in_array($stat, ['n', 'normal', 's', 'success', '1'], true); + \think\Log::error('[shopro_huifu] onboard basic active check stat=' . $stat + . ' active=' . ($active ? '1' : '0') + . ' keys=' . implode(',', array_keys($data))); + return $active; } }