diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs index 37babf05..aaa16f0b 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs @@ -1,4 +1,5 @@ using MongoDB.Driver.Linq; +using Tiobon.Core.Model.Models.RootTkey.Interface; using static Tiobon.Core.Model.Consts; namespace Tiobon.Core.Services; @@ -322,7 +323,7 @@ public class Ghre_StudyRuleServices : BaseServices().FirstAsync(x => x.Id == ruleId); @@ -437,12 +438,12 @@ public class Ghre_StudyRuleServices : BaseServices() - .Where(x => x.StudyRuleId != ruleId && x.StaffId == staff.StaffID) + .Where(x => x.StudyRuleId != null && x.StaffId == staff.StaffID) .WhereIF(!string.IsNullOrWhiteSpace(rule.Year), x => x.Year == rule.Year) .WhereIF(rule.CourseId != null, x => x.CourseId == rule.CourseId) .WhereIF(rule.CourseSceneId != null, x => x.CourseSceneId == rule.CourseSceneId) - //.AS("Ghre_StudyRecord_V") - .FirstAsync(); + //.AS("Ghre_StudyRecord_V") + .ClearFilter().FirstAsync(); if (record is null) { inserts.Add(new Ghre_StudyRecord() @@ -460,7 +461,8 @@ public class Ghre_StudyRuleServices : BaseServices().Where(x => x.Id == ruleId) .SetColumns(it => new Ghre_StudyRule() { Result = E.Message })