@@ -41,11 +41,20 @@ function formatOrderTime(iso: string): string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function formatAmount(n: number): string {
|
||||||
|
// return Number(n || 0).toLocaleString('zh-CN', {
|
||||||
|
// minimumFractionDigits: 0,
|
||||||
|
// maximumFractionDigits: 0,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
function formatAmount(n: number): string {
|
function formatAmount(n: number): string {
|
||||||
return Number(n || 0).toLocaleString('zh-CN', {
|
const num = Number(n || 0);
|
||||||
minimumFractionDigits: 0,
|
// 先保留两位小数,再分割处理
|
||||||
maximumFractionDigits: 0,
|
const fixed = num.toFixed(2);
|
||||||
});
|
const [intStr, decStr] = fixed.split('.');
|
||||||
|
const intFormatted = Number(intStr).toLocaleString('zh-CN');
|
||||||
|
return decStr === '00' ? intFormatted : `${intFormatted}.${decStr}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function amountCssClass(payAmount: number, base: string): string {
|
function amountCssClass(payAmount: number, base: string): string {
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ export class AdminOrdersService {
|
|||||||
startOfToday.setHours(0, 0, 0, 0);
|
startOfToday.setHours(0, 0, 0, 0);
|
||||||
const orders = await this.prisma.order.findMany({
|
const orders = await this.prisma.order.findMany({
|
||||||
where: {
|
where: {
|
||||||
payAmount: { gte: 100 },
|
|
||||||
payStatus: 'PAID',
|
payStatus: 'PAID',
|
||||||
paidAt: { gte: startOfToday },
|
paidAt: { gte: startOfToday },
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user