更新完善页面

This commit is contained in:
董海洋
2026-06-03 14:15:55 +08:00
parent 4b7ae9c933
commit 1675662537
57 changed files with 7625 additions and 883 deletions
+8 -1
View File
@@ -15,12 +15,19 @@ async function getTodayStats(ctx) {
[todayStart, todayEnd]
)
const stockThreshold = parseInt(process.env.STOCK_WARN_THRESHOLD) || 10
const lowStockResult = await query(
'SELECT COUNT(*) as lowStockCount FROM goods WHERE stock < ? AND status != 0',
[stockThreshold]
)
ctx.body = {
code: 200,
data: {
sales: orderResult[0].totalSales,
orders: orderResult[0].orderCount,
customers: customerResult[0].customerCount
customers: customerResult[0].customerCount,
lowStockCount: lowStockResult[0].lowStockCount
}
}
}