Skip to content

Commit fe50278

Browse files
committed
#11252 Account for the review stage ID
1 parent a469cef commit fe50278

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

classes/submission/reviewAssignment/Collector.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,13 @@ public function getQueryBuilder(): Builder
453453
// Aggregate the latest review round number for the given assignment and reviewer
454454
->leftJoinSub(
455455
DB::table('review_assignments as ramax')
456-
->leftJoin('review_rounds as rrmax', 'ramax.review_round_id', '=', 'rrmax.review_round_id')
457-
->select(['ramax.submission_id', 'ramax.reviewer_id'])
458-
->selectRaw('MAX(rrmax.round) as latest_round')
459-
->groupBy(['ramax.submission_id', 'ramax.reviewer_id']),
456+
->select(['ramax.submission_id', 'ramax.reviewer_id', 'ramax.stage_id'])
457+
->selectRaw('MAX(ramax.round) as latest_round')
458+
->whereIn('ramax.reviewer_id', $this->reviewerIds)
459+
->groupBy(['ramax.submission_id', 'ramax.reviewer_id', 'ramax.stage_id']),
460460
'agrmax',
461461
fn (JoinClause $join) => $join->on('ra.submission_id', '=', 'agrmax.submission_id')
462462
)
463-
->whereIn('agrmax.reviewer_id', $this->reviewerIds)
464463
->whereColumn('ra.round', 'agrmax.latest_round') // assignments from the last review round per reviewer only
465464
)
466465
);

0 commit comments

Comments
 (0)