|
|
|
@ -202,7 +202,9 @@ namespace Tiobon.Core.Services |
|
|
|
|
A.CourseSceneId, |
|
|
|
|
A.CourseType, |
|
|
|
|
A.ExamDateType, |
|
|
|
|
A.AfterHowLong |
|
|
|
|
A.AfterHowLong, |
|
|
|
|
A.StudyProgress, |
|
|
|
|
A.ExamId |
|
|
|
|
FROM Ghre_StudyRecord_V A";
|
|
|
|
|
|
|
|
|
|
string conditions = $" WHERE UserId={App.User.ID} "; |
|
|
|
@ -289,6 +291,7 @@ namespace Tiobon.Core.Services |
|
|
|
|
sql += " WHERE NUM <= " + filter.pageNum * filter.pageSize + " AND NUM >" + (filter.pageNum - 1) * filter.pageSize; |
|
|
|
|
|
|
|
|
|
var entitys = await Db.Ado.SqlQueryAsync<Ghre_StudyRecordESS>(sql); |
|
|
|
|
var dt = DateTime.Now.Date; |
|
|
|
|
entitys.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
if (x.CourseBeginDate != null && x.CourseEndDate != null) |
|
|
|
@ -296,6 +299,13 @@ namespace Tiobon.Core.Services |
|
|
|
|
if (x.ExamBeginDate != null && x.ExamEndDate != null) |
|
|
|
|
x.ExamDateString = DateTimeHelper.ConvertToDayString(x.ExamBeginDate) + "~" + DateTimeHelper.ConvertToDayString(x.ExamEndDate); |
|
|
|
|
else x.ExamDateString = $"学完{x.AfterHowLong}天"; |
|
|
|
|
|
|
|
|
|
//if (x.CourseBeginDate != null && x.CourseEndDate != null) |
|
|
|
|
// if (x.StudyProgress >= 100 || !(x.CourseBeginDate.Value.Date <= DateTime.Now.Date && x.CourseEndDate.Value.Date >= DateTime.Now.Date)) |
|
|
|
|
// x.DisableStudyBtn = true; |
|
|
|
|
|
|
|
|
|
if (x.StudyProgress < 100 || x.ExamId.IsNull()) |
|
|
|
|
x.DisableExamBtn = true; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return new ServicePageResult<Ghre_StudyRecordESS>(filter.pageNum, total, filter.pageSize, entitys); |
|
|
|
@ -511,7 +521,7 @@ namespace Tiobon.Core.Services |
|
|
|
|
if (mins > 0) |
|
|
|
|
{ |
|
|
|
|
var duration = record.StudyDuration ?? 0; |
|
|
|
|
studyProgress = (duration / mins)*100; |
|
|
|
|
studyProgress = (duration / mins) * 100; |
|
|
|
|
if (studyProgress > 100) |
|
|
|
|
studyProgress = 100; |
|
|
|
|
} |
|
|
|
@ -522,4 +532,4 @@ namespace Tiobon.Core.Services |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |