v1.2.54 - 寻配号数据增加我的匹配数
This commit is contained in:
parent
b4b4a71640
commit
81ac7fd826
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
}}>
|
||||
<div>
|
||||
<div style={{ color: '#fbbf24', fontSize: '18px', fontWeight: '700' }}>{seekStats.seekCount || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '12px' }}>寻号需求数</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '12px', textAlign: 'center' }}>
|
||||
<div>
|
||||
<div style={{ color: '#fbbf24', fontSize: '18px', fontWeight: '700' }}>{seekStats.seekCount || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '11px' }}>寻号需求</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ color: '#34d399', fontSize: '18px', fontWeight: '700' }}>{seekStats.userMatchedCount || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '11px' }}>我的匹配</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ color: '#a78bfa', fontSize: '18px', fontWeight: '700' }}>{seekStats.totalMatchedCount || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '11px' }}>总共匹配</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
<div style={{ color: '#34d399', fontSize: '18px', fontWeight: '700' }}>{seekStats.matchedCount || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '12px' }}>匹配成功数</div>
|
||||
</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '20px' }}>→</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '20px', textAlign: 'center', marginTop: '8px' }}>→</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue