v1.2.69 - 更新龙钞分类规则关键词

This commit is contained in:
甲辰生产 2026-04-08 20:14:35 +08:00
parent e1ac548115
commit c96033167f
4 changed files with 45 additions and 21 deletions

View File

@ -1 +1 @@
VERSION=1.2.60 1.2.69

View File

@ -256,10 +256,10 @@ async def get_today_category_stats(db: Session = Depends(get_coolbot_db)):
def get_dragons_stats_today( def get_dragons_stats_today(
db: Session = Depends(get_coolbot_db) db: Session = Depends(get_coolbot_db)
): ):
"""获取今日龙钞详细统计数据(按号码分类)""" """获取今日龙钞详细统计数据(按号码分类)- 就高不就低"""
from sqlalchemy import text from sqlalchemy import text
# 带4龙钞包含"龙"且包含"4" # 1. 带4包含"带4"、"带四"、"通货"
dai4 = db.execute(text(""" dai4 = db.execute(text("""
SELECT SELECT
COUNT(*) as total, COUNT(*) as total,
@ -268,10 +268,14 @@ def get_dragons_stats_today(
FROM yichens_posts FROM yichens_posts
WHERE post_time >= CURRENT_DATE WHERE post_time >= CURRENT_DATE
AND category LIKE '%%' 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() """)).fetchone()
# 无4龙钞包含"龙"且包含"无4"但不包含"无47" # 2. 无4包含"无4"、"无四",排除"无47"、"无247"、"无四七"、"永恒"
wu4 = db.execute(text(""" wu4 = db.execute(text("""
SELECT SELECT
COUNT(*) as total, COUNT(*) as total,
@ -280,14 +284,17 @@ def get_dragons_stats_today(
FROM yichens_posts FROM yichens_posts
WHERE post_time >= CURRENT_DATE WHERE post_time >= CURRENT_DATE
AND category LIKE '%%' AND category LIKE '%%'
AND (content LIKE '%无4%' OR title LIKE '%无4%') AND (
AND content NOT LIKE '%无47%' content LIKE '%无4%' OR title LIKE '%无4%'
AND title NOT LIKE '%无47%' OR content LIKE '%无四%' OR title LIKE '%无四%'
AND content NOT LIKE '%无247%' )
AND title NOT LIKE '%无247%' 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() """)).fetchone()
# 无47龙钞包含"龙"且包含"无47"但不包含"无247" # 3. 无47包含"无47"、"永恒"、"无四七",排除"无247"
wu47 = db.execute(text(""" wu47 = db.execute(text("""
SELECT SELECT
COUNT(*) as total, COUNT(*) as total,
@ -296,12 +303,15 @@ def get_dragons_stats_today(
FROM yichens_posts FROM yichens_posts
WHERE post_time >= CURRENT_DATE WHERE post_time >= CURRENT_DATE
AND category LIKE '%%' AND category LIKE '%%'
AND (content LIKE '%无47%' OR title LIKE '%无47%') AND (
AND content NOT LIKE '%无247%' content LIKE '%无47%' OR title LIKE '%无47%'
AND title NOT LIKE '%无247%' OR content LIKE '%永恒%' OR title LIKE '%永恒%'
OR content LIKE '%无四七%' OR title LIKE '%无四七%'
)
AND content NOT LIKE '%无247%' AND title NOT LIKE '%无247%'
""")).fetchone() """)).fetchone()
# 无247龙钞包含"龙"且包含"无247"但不包含"无347" # 4. 无247包含"无247"、"天马"、"金山",排除"无347"
wu247 = db.execute(text(""" wu247 = db.execute(text("""
SELECT SELECT
COUNT(*) as total, COUNT(*) as total,
@ -310,12 +320,15 @@ def get_dragons_stats_today(
FROM yichens_posts FROM yichens_posts
WHERE post_time >= CURRENT_DATE WHERE post_time >= CURRENT_DATE
AND category LIKE '%%' AND category LIKE '%%'
AND (content LIKE '%无247%' OR title LIKE '%无247%') AND (
AND content NOT LIKE '%无347%' content LIKE '%无247%' OR title LIKE '%无247%'
AND title NOT LIKE '%无347%' OR content LIKE '%天马%' OR title LIKE '%天马%'
OR content LIKE '%金山%' OR title LIKE '%金山%'
)
AND content NOT LIKE '%无347%' AND title NOT LIKE '%无347%'
""")).fetchone() """)).fetchone()
# 无347龙钞包含"龙"且包含"无347" # 5. 无347包含"无347"、"钻石"、"金马"、"魅力"、"朦胧"
wu347 = db.execute(text(""" wu347 = db.execute(text("""
SELECT SELECT
COUNT(*) as total, COUNT(*) as total,
@ -324,7 +337,13 @@ def get_dragons_stats_today(
FROM yichens_posts FROM yichens_posts
WHERE post_time >= CURRENT_DATE WHERE post_time >= CURRENT_DATE
AND category LIKE '%%' 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() """)).fetchone()
return { return {

View File

@ -1 +1 @@
VERSION=1.2.63 1.2.69

View File

@ -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 [stats, setStats] = useState({ totalCount: 0, totalCost: 0, totalRevenue: 0, expectedProfit: 0, totalProfit: 0, gradedCount: 0 })
const [recentCollections, setRecentCollections] = useState([]) const [recentCollections, setRecentCollections] = useState([])
const [yichensStats, setYichensStats] = useState({ total: 0, deals: 0, wants: 0, dragons: 0, horses: 0, tianma: 0 }) 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 [seekStats, setSeekStats] = useState({ seekCount: 0, matchedCount: 0 })
const [recentPosts, setRecentPosts] = useState([]) const [recentPosts, setRecentPosts] = useState([])
const [dragonStats, setDragonStats] = useState({}) const [dragonStats, setDragonStats] = useState({})
@ -60,6 +61,10 @@ export default function Home() {
// //
useEffect(() => { 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 => { fetch('/api/yichens/stats/today').then(res => res.json()).then(data => {
setYichensStats(data || {}) setYichensStats(data || {})
}).catch(() => {}) }).catch(() => {})