1
0
mirror of synced 2024-12-04 19:17:58 +01:00

fix ocm sort by competition ID

This commit is contained in:
Shiroi Kitsu 2022-11-28 15:16:29 +07:00
parent 1b7953f688
commit d96778112e
7 changed files with 24 additions and 40 deletions

View File

@ -35,7 +35,7 @@ export default class GhostModule extends Module {
competitionEndAt: { gte: date },
},
orderBy:{
dbId: 'desc'
competitionId: 'desc'
}
});
@ -414,7 +414,7 @@ export default class GhostModule extends Module {
competitionEndAt: { gte: date },
},
orderBy:{
dbId: 'desc'
competitionId: 'desc'
}
});
@ -423,7 +423,7 @@ export default class GhostModule extends Module {
ocmEventDate = await prisma.oCMEvent.findFirst({
orderBy: [
{
dbId: 'desc'
competitionId: 'desc'
},
],
});

View File

@ -30,14 +30,10 @@ export default class StartupModule extends Module {
// competitionEndAt is greater than current date
competitionEndAt: { gte: date },
},
orderBy: [
{
dbId: 'desc'
},
{
competitionEndAt: 'desc',
},
],
orderBy:
{
competitionEndAt: 'desc',
},
});
let pastEvent = 0;
@ -45,7 +41,7 @@ export default class StartupModule extends Module {
{
ocmEventDate = await prisma.oCMEvent.findFirst({
orderBy:{
dbId: 'desc'
competitionId: 'desc'
}
});

View File

@ -356,7 +356,7 @@ export default class UserModule extends Module {
competitionEndAt: { gte: date },
},
orderBy:{
dbId: 'desc'
competitionId: 'desc'
}
});
@ -484,14 +484,10 @@ export default class UserModule extends Module {
if(!ocmEventDate)
{
let ocmEventDate = await prisma.oCMEvent.findFirst({
orderBy: [
{
dbId: 'desc'
},
{
competitionEndAt: 'desc',
},
],
orderBy:
{
competitionEndAt: 'desc',
}
});
if(ocmEventDate)

View File

@ -525,7 +525,7 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
competitionEndAt: { gte: date },
},
orderBy:{
dbId: 'desc'
competitionId: 'desc'
}
});

View File

@ -164,7 +164,7 @@ export async function saveOCMGhostHistory(body: wm.protobuf.SaveGameResultReques
competitionEndAt: { gte: date },
},
orderBy:{
dbId: 'desc'
competitionId: 'desc'
}
});

View File

@ -22,7 +22,7 @@ export async function saveOCMGhostTrail(body: wm.protobuf.RegisterGhostTrailRequ
competitionEndAt: { gte: date },
},
orderBy:{
dbId: 'desc'
competitionId: 'desc'
}
});

View File

@ -21,27 +21,19 @@ export async function getOCMGhostTrail(carId: number, trailId: number)
// competitionEndAt is greater than current date
competitionEndAt: { gte: date },
},
orderBy: [
{
dbId: 'desc'
},
{
competitionEndAt: 'desc',
},
],
orderBy:
{
competitionEndAt: 'desc',
}
});
if(!(ocmEventDate))
{
ocmEventDate = await prisma.oCMEvent.findFirst({
orderBy: [
{
dbId: 'desc'
},
{
competitionEndAt: 'desc',
},
],
orderBy:
{
competitionEndAt: 'desc',
}
});
}