fix: 修复移动端我的订单卡片与搜索栏Flex样式异常
This commit is contained in:
@@ -44,6 +44,7 @@ import {
|
||||
listAllWorkCategories,
|
||||
listPendingMaterialWorkOrdersByPlatformOrderId,
|
||||
listWorkerFinanceRequests,
|
||||
listWorkerCompletionLeaderboard,
|
||||
listWorkerSharesByWorker,
|
||||
listWorkerWalletLedgers,
|
||||
listWorkerWorkOrderNotes,
|
||||
@@ -841,6 +842,22 @@ export async function listWorkerHallOrders(query: JsonObject = {}, session: Work
|
||||
}
|
||||
}
|
||||
|
||||
export async function getWorkerHallLeaderboard(session: WorkerSession) {
|
||||
requireActiveWorkerSession(session)
|
||||
const entries = await listWorkerCompletionLeaderboard({
|
||||
limit: 10,
|
||||
currentWorkerId: session.workerId,
|
||||
})
|
||||
const current = entries.find((entry) => entry.workerId === session.workerId)
|
||||
return {
|
||||
items: entries.filter((entry) => entry.rank <= 10),
|
||||
current: {
|
||||
rank: current?.rank || null,
|
||||
acceptedOrderCount: current?.acceptedOrderCount || 0,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export async function grabWorkerHallOrder(workOrderId: number | string, session: WorkerSession) {
|
||||
requireActiveWorkerSession(session)
|
||||
const worker = await getRequiredWorker(session.workerId)
|
||||
|
||||
Reference in New Issue
Block a user