@@ -4,6 +4,7 @@ using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
namespace Learun.Application.TwoDevelopment.EducationalAdministration
@@ -29,8 +30,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT t.*,leif.LessonTypeId ");
strSql.Append(" FROM StuSelectLessonListOfElective t left join LessonInfo leif on t.LessonNo=leif.LessonNo ");
strSql.Append("SELECT t.*,leif.LessonTypeId,b.StuNumMax,b.StuNum ");
strSql.Append(" FROM StuSelectLessonListOfElective t left join LessonInfo leif on t.LessonNo=leif.LessonNo left join OpenLessonPlanOfElective b on t.OLPEId=b.id ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
@@ -91,7 +92,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
dp.Add("OLPEId", queryParam["OLPEId"].ToString(), DbType.String);
strSql.Append(" AND t.OLPEId = @OLPEId ");
}
return this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListOfElectiveEntity>(strSql.ToString(), dp, pagination);
var list= this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListOfElectiveEntity>(strSql.ToString(), dp, pagination);
foreach (var item in list)
{
//模式二:正式选课
var aa = this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListOfElectiveEntity>(x => x.OLPEId == item.Id);
//已报名人数
item.StuNumOfApply = aa.Where(x => (x.Status == 1 || x.Status == 2)).Count();
//模式一:预选课
//var aaa = this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListOfElectivePreEntity>(x => x.OLPEId == item.Id);
////已报名人数
//item.StuNumOfApplyPre = aaa.Where(x => (x.Status == 1 || x.Status == 2)).Count();
}
return list;
}
catch (Exception ex)
{