修复星标邮件列表不同步和图表空数据不为0

This commit is contained in:
eoao
2025-06-30 15:27:59 +08:00
parent 52e5915d93
commit 22b56781d5
10 changed files with 37 additions and 22 deletions

View File

@@ -2,18 +2,18 @@ const analysisDao = {
async numberCount(c) {
const { results } = await c.env.db.prepare(`
SELECT
e.receiveTotal,
e.sendTotal,
e.delReceiveTotal,
e.delSendTotal,
e.normalReceiveTotal,
e.normalSendTotal,
u.userTotal,
u.normalUserTotal,
u.delUserTotal,
a.accountTotal,
a.normalAccountTotal,
a.delAccountTotal
COALESCE(e.receiveTotal, 0) AS receiveTotal,
COALESCE(e.sendTotal, 0) AS sendTotal,
COALESCE(e.delReceiveTotal, 0) AS delReceiveTotal,
COALESCE(e.delSendTotal, 0) AS delSendTotal,
COALESCE(e.normalReceiveTotal, 0) AS normalReceiveTotal,
COALESCE(e.normalSendTotal, 0) AS normalSendTotal,
COALESCE(u.userTotal, 0) AS userTotal,
COALESCE(u.normalUserTotal, 0) AS normalUserTotal,
COALESCE(u.delUserTotal, 0) AS delUserTotal,
COALESCE(a.accountTotal, 0) AS accountTotal,
COALESCE(a.normalAccountTotal, 0) AS normalAccountTotal,
COALESCE(a.delAccountTotal, 0) AS delAccountTotal
FROM
(
SELECT

View File

@@ -89,7 +89,7 @@ export async function email(message, env, ctx) {
attachment.type = attachment.contentId ? attConst.type.EMBED : attConst.type.ATT;
});
if (attachments.length > 0) {
if (attachments.length > 0 && env.r2) {
await attService.addAtt({ env }, attachments);
}

View File

@@ -34,6 +34,7 @@ const requirePerms = [
'/setting/physicsDeleteAll',
'/setting/setBackground',
'/setting/set',
'/setting/query',
'/user/delete',
'/user/setPwd',
'/user/setStatus',
@@ -63,7 +64,7 @@ const premKey = {
'user:delete': ['/user/delete'],
'sys-email:query': ['/sys-email/list'],
'sys-email:delete': ['/sys-email/delete'],
'setting:query': [],
'setting:query': ['/setting/query'],
'setting:set': ['/setting/set', '/setting/setBackground'],
'setting:clean': ['/setting/physicsDeleteAll'],
'analysis:query': ['/analysis/echarts']