修复邮件数量统计错误

This commit is contained in:
eoao
2025-09-22 21:32:23 +08:00
parent 82bd308d56
commit 86fddf4a5d
4 changed files with 23 additions and 13 deletions

View File

@@ -1,3 +1,5 @@
import { emailConst } from '../const/entity-const';
const analysisDao = {
async numberCount(c) {
const { results } = await c.env.db.prepare(`
@@ -24,7 +26,7 @@ const analysisDao = {
SUM(CASE WHEN type = 0 AND is_del = 0 THEN 1 ELSE 0 END) AS normalReceiveTotal,
SUM(CASE WHEN type = 1 AND is_del = 0 THEN 1 ELSE 0 END) AS normalSendTotal
FROM
email
email where status != ${emailConst.status.SAVING}
) e
CROSS JOIN (
SELECT