From 7dec3c4c48492344e53ff2022bbacb362b04c2a8 Mon Sep 17 00:00:00 2001 From: yml Date: Tue, 24 Nov 2026 22:38:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(fulfillment):=20=E5=AE=A2=E6=88=B7=E8=B5=84?= =?UTF-8?q?=E6=96=99=E6=B8=A0=E9=81=93=E6=AF=94=E5=AF=B9=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E6=89=8BQ=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 线上账号渠道为微信/手Q,不能直接用QQ比较 - 补充手Q+苹果渠道匹配测试 --- tests/test_platform_fulfillment.py | 18 ++++++++++++++++++ .../services/platform_fulfillment/views.py | 9 +++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/tests/test_platform_fulfillment.py b/tests/test_platform_fulfillment.py index 4aa7e47..101b0cc 100644 --- a/tests/test_platform_fulfillment.py +++ b/tests/test_platform_fulfillment.py @@ -3246,6 +3246,24 @@ class TestBindingAndCompletion(_Base): == 1 ) + def test_customer_profile_matches_online_qq_channel_label(self): + task = self._allocated() + account = self.session.get(Account, task.account_id) + account.game_name = "手Q角色" + account.game_channel = "手Q · 苹果(iOS)" + self.session.commit() + + detail = service.save_customer_profile( + self.session, + task_id=task.id, + customer_role_name="手Q角色", + platform="qq", + system="ios", + home_images=[{"url": "https://example.com/qq-home.png"}], + ) + + assert detail["customerProfile"]["channelMatched"] is True + def test_customer_profile_requires_home_image(self): task = self._allocated() with pytest.raises(HTTPException) as exc_info: diff --git a/web/backend/services/platform_fulfillment/views.py b/web/backend/services/platform_fulfillment/views.py index 7429faf..cf90b6d 100644 --- a/web/backend/services/platform_fulfillment/views.py +++ b/web/backend/services/platform_fulfillment/views.py @@ -710,10 +710,15 @@ def _customer_profile_out( if role and platform_role: role_matched = role == platform_role channel_matched: bool | None = None + # 线上账号渠道写作「微信 / 手Q」,QQ 不能直接拿 "QQ" 去比。 customer_channel = " ".join( [ - "微信" if task.customer_platform == "wechat" else ("QQ" if task.customer_platform == "qq" else ""), - "苹果" if task.customer_system == "ios" else ("安卓" if task.customer_system == "android" else ""), + "微信" + if task.customer_platform == "wechat" + else ("手Q" if task.customer_platform == "qq" else ""), + "苹果" + if task.customer_system == "ios" + else ("安卓" if task.customer_system == "android" else ""), ] ).strip() account_channel = str(