diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs index daca44dd..e8b3dd4f 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs @@ -37,19 +37,18 @@ public class Ghre_StudyRecordServices : BaseServices().Where(x => x.DataPrivType == "Priv" && x.MenuNo == filter.menuName).AnyAsync()) { var staffIds = await GetUserStaffPrivIds((int)App.User.ID); if (staffIds.Any()) - conditions = $" WHERE BeginTime IS NOT NULL AND StaffId IN ({string.Join(",", staffIds.Select(id => "'" + id + "'"))})"; + conditions = $" WHERE ((BeginTime IS NOT NULL AND ( IsRequireStudy='true' OR IsRequireStudy IS NULL )) OR IsRequireStudy='false') AND StaffId IN ({string.Join(",", staffIds.Select(id => "'" + id + "'"))})"; } if (IsEnable == true) conditions += " AND IsEnable = 1"; else if (IsEnable == false) conditions += " AND IsEnable = 0"; - conditions += " AND (IsRequireStudy = 'true' OR IsRequireStudy IS NULL)"; if (!string.IsNullOrWhiteSpace(condition)) conditions += " AND " + condition;