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' }}> -