You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentDataService.cs
+2-3Lines changed: 2 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -230,21 +230,20 @@ FROM SelfAssessments
230
230
sa.SupervisorResultsReview";
231
231
232
232
varfromTableQuery=$@" FROM dbo.SelfAssessments AS sa
233
-
INNER JOIN CourseCategories AS cc ON sa.CategoryID = cc.CourseCategoryID
234
233
INNER JOIN dbo.CandidateAssessments AS ca WITH (NOLOCK) ON sa.ID = ca.SelfAssessmentID
235
234
INNER JOIN dbo.CentreSelfAssessments AS csa WITH (NOLOCK) ON sa.ID = csa.SelfAssessmentID
236
235
INNER JOIN dbo.DelegateAccounts da WITH (NOLOCK) ON ca.CentreID = da.CentreID AND ca.DelegateUserID = da.UserID AND da.CentreID = csa.CentreID
237
236
INNER JOIN dbo.Users u WITH (NOLOCK) ON DA.UserID = u.ID
238
237
LEFT JOIN UserCentreDetails AS ucd WITH (NOLOCK) ON ucd.UserID = da.UserID AND ucd.centreID = da.CentreID
239
-
LEFT OUTER JOIN AdminAccounts AS aaEnrolledBy WITH (NOLOCK) ON aaEnrolledBy.ID = ca.EnrolledByAdminID AND aaEnrolledBy.CategoryID = cc.CourseCategoryID
238
+
LEFT OUTER JOIN AdminAccounts AS aaEnrolledBy WITH (NOLOCK) ON aaEnrolledBy.ID = ca.EnrolledByAdminID
240
239
LEFT OUTER JOIN Users AS uEnrolledBy WITH (NOLOCK) ON uEnrolledBy.ID = aaEnrolledBy.UserID
241
240
LEFT JOIN dbo.CandidateAssessmentSupervisors AS cas WITH (NOLOCK) ON ca.ID = cas.CandidateAssessmentID
242
241
LEFT JOIN dbo.CandidateAssessmentSupervisorVerifications AS casv WITH (NOLOCK) ON cas.ID = casv.CandidateAssessmentSupervisorID AND
243
242
(casv.Verified IS NOT NULL AND casv.SignedOff = 1)
244
243
245
244
WHERE sa.ID = @selfAssessmentId
246
245
AND da.CentreID = @centreID AND csa.CentreID = @centreID
247
-
AND (ca.RemovedDate IS NULL)
246
+
AND (ca.RemovedDate IS NULL) AND ( aaEnrolledBy.CategoryID IS NULL OR sa.CategoryID = aaEnrolledBy.CategoryID)
0 commit comments