修复星标邮件列表不同步和图表空数据不为0
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user