新增后台接单排行榜支持周期与自定义区间筛选

This commit is contained in:
yml2213
2026-08-22 09:48:09 +08:00
parent ed81122047
commit f1e219d1ef
8 changed files with 383 additions and 0 deletions
@@ -36,6 +36,37 @@ type WorkOrderVoucherConsumeResult = {
errorMessage: string
}
export type AdminLeaderboardPeriod = 'all' | 'daily' | 'weekly' | 'monthly'
export type AdminWorkerLeaderboardEntry = {
rank: number
workerId: number
username: string
displayName: string
levelName: string
workerStatus: string
acceptedOrderCount: number
rewardAmount: number
lastAcceptedAt: string | null
}
export function fetchAdminWorkerLeaderboard(
period: AdminLeaderboardPeriod,
limit = 50,
range?: { from: string; to: string },
) {
return apiGet<{
period: AdminLeaderboardPeriod | 'custom'
from: string | null
to: string | null
items: AdminWorkerLeaderboardEntry[]
}>('/api/v1/admin/worker-platform/leaderboard', {
period,
limit,
...(range ? { from: range.from, to: range.to } : {}),
})
}
export function fetchAdminWorkerPlatformSummary() {
return apiGet<{
pendingWorkerCount: number