diff --git a/VERSION b/VERSION index 307f000..f2254f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -VERSION=1.2.60 +1.2.69 diff --git a/backend/app/routers/yichens.py b/backend/app/routers/yichens.py index 695b672..296d4d0 100644 --- a/backend/app/routers/yichens.py +++ b/backend/app/routers/yichens.py @@ -256,10 +256,10 @@ async def get_today_category_stats(db: Session = Depends(get_coolbot_db)): def get_dragons_stats_today( db: Session = Depends(get_coolbot_db) ): - """获取今日龙钞详细统计数据(按号码分类)""" + """获取今日龙钞详细统计数据(按号码分类)- 就高不就低""" from sqlalchemy import text - # 带4龙钞(包含"龙"且包含"4") + # 1. 带4:包含"带4"、"带四"、"通货" dai4 = db.execute(text(""" SELECT COUNT(*) as total, @@ -268,10 +268,14 @@ def get_dragons_stats_today( FROM yichens_posts WHERE post_time >= CURRENT_DATE AND category LIKE '%龙%' - AND (content LIKE '%带4%' OR title LIKE '%带4%') + AND ( + content LIKE '%带4%' OR title LIKE '%带4%' + OR content LIKE '%带四%' OR title LIKE '%带四%' + OR content LIKE '%通货%' OR title LIKE '%通货%' + ) """)).fetchone() - # 无4龙钞(包含"龙"且包含"无4"但不包含"无47") + # 2. 无4:包含"无4"、"无四",排除"无47"、"无247"、"无四七"、"永恒" wu4 = db.execute(text(""" SELECT COUNT(*) as total, @@ -280,14 +284,17 @@ def get_dragons_stats_today( FROM yichens_posts WHERE post_time >= CURRENT_DATE AND category LIKE '%龙%' - AND (content LIKE '%无4%' OR title LIKE '%无4%') - AND content NOT LIKE '%无47%' - AND title NOT LIKE '%无47%' - AND content NOT LIKE '%无247%' - AND title NOT LIKE '%无247%' + AND ( + content LIKE '%无4%' OR title LIKE '%无4%' + OR content LIKE '%无四%' OR title LIKE '%无四%' + ) + AND content NOT LIKE '%无47%' AND title NOT LIKE '%无47%' + AND content NOT LIKE '%无247%' AND title NOT LIKE '%无247%' + AND content NOT LIKE '%永恒%' AND title NOT LIKE '%永恒%' + AND content NOT LIKE '%无四七%' AND title NOT LIKE '%无四七%' """)).fetchone() - # 无47龙钞(包含"龙"且包含"无47"但不包含"无247") + # 3. 无47:包含"无47"、"永恒"、"无四七",排除"无247" wu47 = db.execute(text(""" SELECT COUNT(*) as total, @@ -296,12 +303,15 @@ def get_dragons_stats_today( FROM yichens_posts WHERE post_time >= CURRENT_DATE AND category LIKE '%龙%' - AND (content LIKE '%无47%' OR title LIKE '%无47%') - AND content NOT LIKE '%无247%' - AND title NOT LIKE '%无247%' + AND ( + content LIKE '%无47%' OR title LIKE '%无47%' + OR content LIKE '%永恒%' OR title LIKE '%永恒%' + OR content LIKE '%无四七%' OR title LIKE '%无四七%' + ) + AND content NOT LIKE '%无247%' AND title NOT LIKE '%无247%' """)).fetchone() - # 无247龙钞(包含"龙"且包含"无247"但不包含"无347") + # 4. 无247:包含"无247"、"天马"、"金山",排除"无347" wu247 = db.execute(text(""" SELECT COUNT(*) as total, @@ -310,12 +320,15 @@ def get_dragons_stats_today( FROM yichens_posts WHERE post_time >= CURRENT_DATE AND category LIKE '%龙%' - AND (content LIKE '%无247%' OR title LIKE '%无247%') - AND content NOT LIKE '%无347%' - AND title NOT LIKE '%无347%' + AND ( + content LIKE '%无247%' OR title LIKE '%无247%' + OR content LIKE '%天马%' OR title LIKE '%天马%' + OR content LIKE '%金山%' OR title LIKE '%金山%' + ) + AND content NOT LIKE '%无347%' AND title NOT LIKE '%无347%' """)).fetchone() - # 无347龙钞(包含"龙"且包含"无347") + # 5. 无347:包含"无347"、"钻石"、"金马"、"魅力"、"朦胧" wu347 = db.execute(text(""" SELECT COUNT(*) as total, @@ -324,7 +337,13 @@ def get_dragons_stats_today( FROM yichens_posts WHERE post_time >= CURRENT_DATE AND category LIKE '%龙%' - AND (content LIKE '%无347%' OR title LIKE '%无347%') + AND ( + content LIKE '%无347%' OR title LIKE '%无347%' + OR content LIKE '%钻石%' OR title LIKE '%钻石%' + OR content LIKE '%金马%' OR title LIKE '%金马%' + OR content LIKE '%魅力%' OR title LIKE '%魅力%' + OR content LIKE '%朦胧%' OR title LIKE '%朦胧%' + ) """)).fetchone() return { diff --git a/config/VERSION b/config/VERSION index 5effd94..f2254f4 100644 --- a/config/VERSION +++ b/config/VERSION @@ -1 +1 @@ -VERSION=1.2.63 +1.2.69 diff --git a/frontend/src/pages/Home.jsx b/frontend/src/pages/Home.jsx index 781157d..7022bb9 100644 --- a/frontend/src/pages/Home.jsx +++ b/frontend/src/pages/Home.jsx @@ -6,6 +6,7 @@ export default function Home() { const [stats, setStats] = useState({ totalCount: 0, totalCost: 0, totalRevenue: 0, expectedProfit: 0, totalProfit: 0, gradedCount: 0 }) const [recentCollections, setRecentCollections] = useState([]) const [yichensStats, setYichensStats] = useState({ total: 0, deals: 0, wants: 0, dragons: 0, horses: 0, tianma: 0 }) + const [dragonStats, setDragonStats] = useState({}) const [seekStats, setSeekStats] = useState({ seekCount: 0, matchedCount: 0 }) const [recentPosts, setRecentPosts] = useState([]) const [dragonStats, setDragonStats] = useState({}) @@ -60,6 +61,10 @@ export default function Home() { // 获取一尘看板数据 useEffect(() => { + fetch('/api/yichens/stats/dragons-today').then(res => res.json()).then(data => { + setDragonStats(data || {}) + }).catch(() => {}) + fetch('/api/yichens/stats/today').then(res => res.json()).then(data => { setYichensStats(data || {}) }).catch(() => {})