微信小程序页面迁移校验之前 P5任务处理之前

This commit is contained in:
Neo
2026-03-09 01:19:21 +08:00
parent 263bf96035
commit 6e20987d2f
1112 changed files with 153824 additions and 219694 deletions

View File

@@ -0,0 +1,30 @@
"""查询 auth.user_applications 和对应用户状态"""
import os
import psycopg2
from dotenv import load_dotenv
load_dotenv()
dsn = os.environ["APP_DB_DSN"]
conn = psycopg2.connect(dsn)
cur = conn.cursor()
# 查申请记录
cur.execute("""
SELECT a.id, a.user_id, a.site_code, a.applied_role_text, a.phone,
a.status AS app_status, a.created_at,
u.wx_openid, u.status AS user_status, u.nickname
FROM auth.user_applications a
JOIN auth.users u ON u.id = a.user_id
ORDER BY a.created_at DESC
LIMIT 20
""")
rows = cur.fetchall()
cols = [d[0] for d in cur.description]
print(f"{len(rows)} 条申请记录:\n")
for row in rows:
for c, v in zip(cols, row):
print(f" {c}: {v}")
print()
conn.close()