mirror of
https://github.com/shiroikitsu8/Bayshore_6r_legacy.git
synced 2024-12-03 19:47:17 +01:00
commit
05835fded6
@ -631,30 +631,17 @@ export default class TerminalModule extends Module {
|
|||||||
{
|
{
|
||||||
console.log('Current OCM Day : Competition Day / Main Draw');
|
console.log('Current OCM Day : Competition Day / Main Draw');
|
||||||
|
|
||||||
// Get Current OCM Period
|
// Get Current OCM Period and All User's Record
|
||||||
let OCMCurrentPeriod = await prisma.oCMPeriod.findFirst({
|
|
||||||
where: {
|
|
||||||
competitionDbId: ocmEventDate!.dbId,
|
|
||||||
competitionId: ocmEventDate!.competitionId,
|
|
||||||
startAt:
|
|
||||||
{
|
|
||||||
lte: date, // competitionStartAt is less than current date
|
|
||||||
},
|
|
||||||
closeAt:
|
|
||||||
{
|
|
||||||
gte: date, // competitionCloseAt is greater than current date
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
let ocmParticipant = await prisma.oCMTally.findMany({
|
let ocmParticipant = await prisma.oCMTally.findMany({
|
||||||
where:{
|
where:{
|
||||||
competitionId: ocmEventDate!.competitionId,
|
competitionId: ocmEventDate!.competitionId,
|
||||||
periodId: OCMCurrentPeriod!.periodId
|
|
||||||
},
|
},
|
||||||
orderBy: {
|
orderBy: [
|
||||||
result: 'desc'
|
{
|
||||||
|
result: 'desc',
|
||||||
|
periodId: 'desc'
|
||||||
}
|
}
|
||||||
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
numOfParticipants = ocmParticipant.length;
|
numOfParticipants = ocmParticipant.length;
|
||||||
@ -663,6 +650,8 @@ export default class TerminalModule extends Module {
|
|||||||
|
|
||||||
if(ocmParticipant)
|
if(ocmParticipant)
|
||||||
{
|
{
|
||||||
|
periodId = ocmParticipant[0].periodId;
|
||||||
|
|
||||||
for(let i=0; i<ocmParticipant.length; i++)
|
for(let i=0; i<ocmParticipant.length; i++)
|
||||||
{
|
{
|
||||||
let cars = await prisma.car.findFirst({
|
let cars = await prisma.car.findFirst({
|
||||||
|
Loading…
Reference in New Issue
Block a user