auto: sync OpenClaw config 2026-08-08 23:17
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
import pymysql, json
|
||||
cfg = json.load(open('db_config.json'))
|
||||
conn = pymysql.connect(host=cfg['host'], port=cfg['port'], user=cfg['user'],
|
||||
password=cfg.get('password'), database=cfg['database'], charset='utf8mb4')
|
||||
cur = conn.cursor()
|
||||
cur.execute("""SELECT category, amount, recorded_date, note FROM variable_expenses
|
||||
WHERE member_id=3 AND recorded_date BETWEEN '2026-01-01' AND '2026-06-30'
|
||||
AND note LIKE '%[微信]%' ORDER BY amount DESC LIMIT 30""")
|
||||
print("=== 微信导入大额TOP30 ===")
|
||||
for c, a, dt, n in cur.fetchall():
|
||||
parts = n.split('|')
|
||||
peer = parts[2] if len(parts) > 2 else ''
|
||||
goods = parts[3] if len(parts) > 3 else ''
|
||||
print(f" {c:8s} ¥{float(a):>9.2f} {dt} {peer[:20]:20s} {goods[:30]}")
|
||||
conn.close()
|
||||
Reference in New Issue
Block a user