feat(workshop): 账号列表去地区列+加AI脚本列(数量/跳转该账号AI写脚本) v22

- dsh-data listAccounts 增 rewrite_count 子查询(口径同视频页:rewrite_log done 且有脚本)
- renderAccounts:删地区列,操作列左加「AI脚本」列——数量>0 显示为链接,0 显示 —
- 跳转 #/rewrites/<账号名>:parseHash param 传 renderRewrites(view, initAccount),预填搜索+note 提示该账号上下文
- app.js rewrites 路由透传 param;空行 colspan 13/12→12/11
This commit is contained in:
maogeigei committed 2026-09-02 18:59:02 +08:00
1 parent 97263519e5
commit 5881610d71
3 files changed
+10 -8

No files matched your search

@@ -112,7 +112,9 @@ function listAccounts({ page = 1, pageSize = 20, search = '', track = '', type =
const offset = (Math.max(1, Number(page) || 1) - 1) * limit;
const followersExpr = `CASE WHEN h.followers LIKE '%亿%' THEN CAST(REPLACE(REPLACE(h.followers,'亿',''),'万','') AS REAL) * 100000000 WHEN h.followers LIKE '%万%' THEN CAST(REPLACE(h.followers,'万','') AS REAL) * 10000 ELSE CAST(h.followers AS REAL) END`;
const orderBySql = `h.favorite DESC, ${followersExpr} DESC, h.id ASC`;
const items = d.prepare(`SELECT h.*, (SELECT COUNT(*) FROM account_videos v WHERE v.account_id = h.id) AS video_count FROM hot_accounts h ${whereSql} ORDER BY ${orderBySql} LIMIT ? OFFSET ?`).all(...params, limit, offset);
const items = d.prepare(`SELECT h.*, (SELECT COUNT(*) FROM account_videos v WHERE v.account_id = h.id) AS video_count,
(SELECT COUNT(*) FROM rewrite_log r WHERE r.account_id = h.id AND r.status='done' AND r.script_text IS NOT NULL AND r.script_text <> '') AS rewrite_count
FROM hot_accounts h ${whereSql} ORDER BY ${orderBySql} LIMIT ? OFFSET ?`).all(...params, limit, offset);
return { total, page: Math.max(1, Number(page) || 1), pageSize: limit, items };
}