修复Mysql
This commit is contained in:
@@ -34,9 +34,13 @@ public sealed class WarningsController(AppDbContext db, ICurrentUserDataScope sc
|
||||
{
|
||||
db.WarningRules.Add(new WarningRule
|
||||
{
|
||||
AcademicTermId = academicTermId, Type = r.Type, Name = r.Name.Trim(),
|
||||
Threshold = r.Threshold, IsEnabled = r.IsEnabled,
|
||||
NotifyStudent = r.NotifyStudent, NotifyCounselor = r.NotifyCounselor,
|
||||
AcademicTermId = academicTermId,
|
||||
Type = r.Type,
|
||||
Name = r.Name.Trim(),
|
||||
Threshold = r.Threshold,
|
||||
IsEnabled = r.IsEnabled,
|
||||
NotifyStudent = r.NotifyStudent,
|
||||
NotifyCounselor = r.NotifyCounselor,
|
||||
Description = r.Description?.Trim(),
|
||||
AutoCheckEnabled = r.AutoCheckEnabled,
|
||||
CheckDayOfWeek = r.CheckDayOfWeek == 0 ? null : r.CheckDayOfWeek,
|
||||
@@ -110,7 +114,7 @@ public sealed class WarningsController(AppDbContext db, ICurrentUserDataScope sc
|
||||
{
|
||||
var classIds = await db.AdministrativeClasses.Where(c => c.CounselorUserId == scope.Current.UserId).Select(c => c.Id).ToListAsync(ct);
|
||||
if (classIds.Count > 0)
|
||||
q = q.Where(x => classIds.Contains(x.Student!.AdministrativeClassId));
|
||||
q = q.WhereIn(classIds, x => x.Student!.AdministrativeClassId);
|
||||
else if (scope.Current.RestrictedCollegeId.HasValue)
|
||||
q = q.Where(x => x.Student!.AdministrativeClass!.Major!.CollegeId == scope.Current.RestrictedCollegeId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user