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(