diff --git a/Tiobon.Core.Services/CommonServices.cs b/Tiobon.Core.Services/CommonServices.cs index 9119c395..e37a3084 100644 --- a/Tiobon.Core.Services/CommonServices.cs +++ b/Tiobon.Core.Services/CommonServices.cs @@ -310,7 +310,7 @@ public partial class CommonServices : BaseServices>, ICommon AND a.UserID = '{1}' AND a.IsEnable = 1 AND a.PageSettingQueryId = b.PageSettingQueryId"; - sql = string.Format(sql, param.menuName, App.User.ID, param.langId); + sql = string.Format(sql, param.menuName, App.User.ID, param.langId); int UserHasSetting = Db.Ado.GetInt(sql); if (UserHasSetting == 0) { diff --git a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs index 640d14a3..40ebed8d 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs @@ -37,18 +37,14 @@ public class Ghre_QuestionServices : BaseServices>(); - var courseIds = data.Where(x => x.CourseId != null).Select(x => x.CourseId).ToList(); + var courseIds = data.Where(x => x.CourseId != null).Select(x => x.CourseId).Distinct().ToList(); var courses = await _ghre_CourseServices.Query(x => courseIds.Contains(x.Id)); - var classs = await _ghre_CourseClassServices.Query(); + var classsIds = courses.Select(x => x.CourseClassId).Distinct().ToList(); + var classs = await _ghre_CourseClassServices.Query(x => classsIds.Contains(x.Id)); data.ForEach(x => { - if (x.DifficultyLevel == "Easy") - x.DifficultyLevel = "简单"; - else if (x.DifficultyLevel == "Normal") - x.DifficultyLevel = "普通"; - else if (x.DifficultyLevel == "Hard") - x.DifficultyLevel = "困难"; + x.DifficultyLevel = ConvertDifficultyLevel(x.DifficultyLevel); x.QuestionType = ConvertQuestionType(x.QuestionType); if (x.CourseId != null) @@ -493,7 +489,7 @@ public class Ghre_QuestionServices : BaseServices