zhouj1203@hotmail.com vor 1 Jahr
Ursprung
Commit
14dd28c688
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      TEAMModelOS.SDK/Models/Service/StudentService.cs

+ 2 - 2
TEAMModelOS.SDK/Models/Service/StudentService.cs

@@ -147,7 +147,7 @@ namespace TEAMModelOS.SDK
                     subjectJoin = "join s in c.subjects";
                     subjectJoin = "join s in c.subjects";
                     subjectSQL = $" and  s.id in ({string.Join(",", subjects.Select(z => $"'{z}'"))}) ";
                     subjectSQL = $" and  s.id in ({string.Join(",", subjects.Select(z => $"'{z}'"))}) ";
                 }
                 }
-                StringBuilder SQL = new StringBuilder($"select {filed} from c {subjectJoin} where c.pk='Exam' {subjectSQL} {groupListSQL} and c.startTime>={stime} and c.startTime <= {etime} ");
+                StringBuilder SQL = new StringBuilder($"select distinct {filed} from c {subjectJoin} where c.pk='Exam' {subjectSQL} {groupListSQL} and c.startTime>={stime} and c.startTime <= {etime} ");
                 //获取学校发布的活动
                 //获取学校发布的活动
                 if (userScope.Equals(Constant.ScopeStudent) && !string.IsNullOrWhiteSpace(school))
                 if (userScope.Equals(Constant.ScopeStudent) && !string.IsNullOrWhiteSpace(school))
                 {
                 {
@@ -226,7 +226,7 @@ namespace TEAMModelOS.SDK
                     subjectSQL = $" and  s.id in ({string.Join(",", subjects.Select(z => $"'{z}'"))}) ";
                     subjectSQL = $" and  s.id in ({string.Join(",", subjects.Select(z => $"'{z}'"))}) ";
                 }
                 }
 
 
-                StringBuilder SQL = new($"select {filed} from c  {subjectJoin} where c.pk='Art' {subjectSQL} {groupListSQL} and c.startTime>={stime} and c.startTime <= {etime} ");
+                StringBuilder SQL = new($"select distinct  {filed} from c  {subjectJoin} where c.pk='Art' {subjectSQL} {groupListSQL} and c.startTime>={stime} and c.startTime <= {etime} ");
                 //获取学校发布的活动
                 //获取学校发布的活动
                 if (userScope.Equals(Constant.ScopeStudent) && !string.IsNullOrWhiteSpace(school))
                 if (userScope.Equals(Constant.ScopeStudent) && !string.IsNullOrWhiteSpace(school))
                 {
                 {