20221114知识竞赛人员类型抽取优化

This commit is contained in:
2022-11-14 18:35:17 +08:00
parent a0a3f525ab
commit 419320e354
3 changed files with 5 additions and 5 deletions
@@ -163,7 +163,7 @@ namespace BLL
{
if (getTestPlan.TestEndTime > DateTime.Now)
{
var getTestPlanTraining = db.Test_TestPlanTraining.Where(x => x.TestPlanId == getTestPlan.TestPlanId && x.UserType == testRecord.UserType);
var getTestPlanTraining = db.Test_TestPlanTraining.Where(x => x.TestPlanId == getTestPlan.TestPlanId && (x.UserType == testRecord.UserType || x.UserType == null));
if (getTestPlanTraining.Count() > 0)
{
int cout1 = getTestPlanTraining.Sum(x => x.TestType1Count ?? 0);
@@ -294,7 +294,7 @@ namespace BLL
var item = db.Test_TestRecordItem.FirstOrDefault(x => x.TestRecordId == testRecordId);
if (item == null)
{
var getTestPlanTraining = db.Test_TestPlanTraining.Where(x => x.TestPlanId == testPlanId && x.UserType == getTestRecord.ManType);
var getTestPlanTraining = db.Test_TestPlanTraining.Where(x => x.TestPlanId == testPlanId && (x.UserType == getTestRecord.ManType || x.UserType == null));
if (getTestPlanTraining.Count() > 0)
{
List<Model.Training_TestTrainingItem> getTestTrainingItemList = new List<Model.Training_TestTrainingItem>();