培训记录需显示无需学习的考试记录

master
xiaochanghai 3 months ago
parent 743434c7d1
commit ea531c2049
  1. 5
      Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs

@ -37,19 +37,18 @@ public class Ghre_StudyRecordServices : BaseServices<Ghre_StudyRecord, Ghre_Stud
var sql = @$" SELECT * var sql = @$" SELECT *
FROM Ghre_StudyRecord_V A"; FROM Ghre_StudyRecord_V A";
string conditions = " WHERE BeginTime IS NOT NULL "; string conditions = " WHERE ((BeginTime IS NOT NULL AND ( IsRequireStudy='true' OR IsRequireStudy IS NULL )) OR IsRequireStudy='false') ";
if (await Db.Queryable<Ghrs_Menu>().Where(x => x.DataPrivType == "Priv" && x.MenuNo == filter.menuName).AnyAsync()) if (await Db.Queryable<Ghrs_Menu>().Where(x => x.DataPrivType == "Priv" && x.MenuNo == filter.menuName).AnyAsync())
{ {
var staffIds = await GetUserStaffPrivIds((int)App.User.ID); var staffIds = await GetUserStaffPrivIds((int)App.User.ID);
if (staffIds.Any()) 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) if (IsEnable == true)
conditions += " AND IsEnable = 1"; conditions += " AND IsEnable = 1";
else if (IsEnable == false) else if (IsEnable == false)
conditions += " AND IsEnable = 0"; conditions += " AND IsEnable = 0";
conditions += " AND (IsRequireStudy = 'true' OR IsRequireStudy IS NULL)";
if (!string.IsNullOrWhiteSpace(condition)) if (!string.IsNullOrWhiteSpace(condition))
conditions += " AND " + condition; conditions += " AND " + condition;

Loading…
Cancel
Save