试卷 引用次数

master
xiaochanghai 11 months ago
parent 44ed47e709
commit 6d898d9695
  1. 10
      Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs

@ -569,11 +569,21 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
if (entity is null)
return ServiceResult.OprateFailed("无效的考试ID!");
#region 试卷 引用次数
if (entity.Status == "Wait")
{
string sql = $"UPDATE Ghre_ExamPaper SET LinkTimes = ISNULL(LinkTimes, 0)+1 WHERE Id={entity.ExamPaperId}";
await Db.Ado.ExecuteCommandAsync(sql);
}
#endregion
if (entity.ActualBeginTime is null)
entity.ActualBeginTime = DateTime.Now;
if (entity.Status == "Wait")
entity.Status = "Examing";
await Update(entity, new List<string>()
{
"ActualBeginTime",

Loading…
Cancel
Save