From 81ac7fd8268849f8154923b48079a0ab39563349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B2=E8=BE=B0=E7=94=9F=E4=BA=A7?= Date: Wed, 8 Apr 2026 13:07:55 +0800 Subject: [PATCH] =?UTF-8?q?v1.2.54=20-=20=E5=AF=BB=E9=85=8D=E5=8F=B7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A2=9E=E5=8A=A0=E6=88=91=E7=9A=84=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/information.py | 17 ++++++++++++++--- frontend/src/pages/Home.jsx | 27 +++++++++++++++------------ 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/backend/app/routers/information.py b/backend/app/routers/information.py index 9a70e31..f981a63 100644 --- a/backend/app/routers/information.py +++ b/backend/app/routers/information.py @@ -1083,13 +1083,24 @@ def get_seek_stats( Information.info_type == 'seek' ).count() - # 匹配成功总条数(is_matched = 'confirmed') - matched_count = db.query(Information).filter( + # 我的藏品匹配成功数(is_matched = 'confirmed'且有matched_user_id) + user_matched_count = 0 + if current_user: + user_matched_count = db.query(Information).filter( + Information.info_type == 'seek', + Information.is_matched == 'confirmed', + Information.matched_user_id == current_user.f99_90_id + ).count() + + # 总共匹配成功数(包含我的藏品匹配+网络数据匹配成功的) + # 网络数据匹配成功的定义:is_matched = 'confirmed' + total_matched_count = db.query(Information).filter( Information.info_type == 'seek', Information.is_matched == 'confirmed' ).count() return { "seekCount": seek_count, - "matchedCount": matched_count + "userMatchedCount": user_matched_count, + "totalMatchedCount": total_matched_count } diff --git a/frontend/src/pages/Home.jsx b/frontend/src/pages/Home.jsx index 1ed4609..570df38 100644 --- a/frontend/src/pages/Home.jsx +++ b/frontend/src/pages/Home.jsx @@ -203,20 +203,23 @@ export default function Home() { borderRadius: '12px', padding: '16px', border: '1px solid rgba(245,158,11,0.2)', - cursor: 'pointer', - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center' + cursor: 'pointer' }}> -
-
{seekStats.seekCount || 0}
-
寻号需求数
+
+
+
{seekStats.seekCount || 0}
+
寻号需求
+
+
+
{seekStats.userMatchedCount || 0}
+
我的匹配
+
+
+
{seekStats.totalMatchedCount || 0}
+
总共匹配
+
-
-
{seekStats.matchedCount || 0}
-
匹配成功数
-
-
+