File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,19 @@ const getPlays = async (
193
193
)
194
194
. select ( [ 'athlete.id' , 'athlete.name' ] ) ,
195
195
) . as ( 'participants' ) ,
196
+ jsonArrayFrom (
197
+ eb
198
+ . selectFrom ( 'substitution' )
199
+ . innerJoin ( 'athlete' , 'substitution.athleteId' , 'athlete.id' )
200
+ . innerJoin ( 'team' , 'substitution.teamId' , 'team.id' )
201
+ . whereRef ( 'substitution.gameId' , '=' , 'gameInfo.id' )
202
+ . where (
203
+ 'substitution.timeRange' ,
204
+ '@>' ,
205
+ sql < string > `(CASE WHEN play.period = 1 THEN 1200 - play.seconds_remaining WHEN play.period = 2 THEN 2400 - play.seconds_remaining ELSE 2400 + (play.period - 2) * 300 - play.seconds_remaining END)::numeric` ,
206
+ )
207
+ . select ( [ 'athlete.id' , 'athlete.name' , 'team.school as team' ] ) ,
208
+ ) . as ( 'onFloor' ) ,
196
209
] ) ;
197
210
198
211
if ( season ) {
@@ -325,6 +338,7 @@ const getPlays = async (
325
338
: { x : null , y : null } ,
326
339
}
327
340
: null ,
341
+ onFloor : play . onFloor ,
328
342
} ;
329
343
} )
330
344
. filter ( ( play ) => play . gameId !== - 1 ) ;
Original file line number Diff line number Diff line change @@ -67,6 +67,14 @@ export interface PlayInfo {
67
67
id : number ;
68
68
name : string ;
69
69
} [ ] ;
70
+ onFloor : {
71
+ /**
72
+ * @isInt
73
+ */
74
+ id : number ;
75
+ name : string ;
76
+ team : string ;
77
+ } [ ] ;
70
78
shotInfo : ShotInfo | null ;
71
79
}
72
80
You can’t perform that action at this time.
0 commit comments