Commit d204940b authored by 黄奎's avatar 黄奎

页面修改

parent 0583781f
......@@ -206,6 +206,11 @@ namespace Edu.Model.ViewModel.Course
}
}
/// <summary>
/// 查询有未报满的班级
/// </summary>
public int IsQuerySurplus { get; set; }
}
/// <summary>
......
......@@ -24,8 +24,9 @@ namespace Edu.Repository.Course
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM rb_class AS A
SELECT A.* ,IFNULL(B.CourseName,'') AS CourseName,IFNULL(C.GuestNum,0) AS GuestNum
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN(SELECT ClassId,SUM(GuestNum) AS GuestNum FROM rb_order WHERE OrderState=1 GROUP BY ClassId) AS C ON A.ClassId=C.ClassId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Status), (int)DateStateEnum.Normal);
......@@ -47,6 +48,11 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0} in({1}) ", nameof(RB_Class_ViewModel.ClassId), query.Q_ClassIds);
}
//查询未报满的班级
if (query.IsQuerySurplus == 1)
{
builder.AppendFormat(" AND A.{0}>IFNULL(C.GuestNum,0) ",nameof(RB_Class_ViewModel.ClassPersion));
}
}
return Get<RB_Class_ViewModel>(builder.ToString()).ToList();
}
......
......@@ -122,6 +122,7 @@ namespace Edu.WebApi.Controllers.Course
var query = new RB_Class_ViewModel()
{
CouseId = base.ParmJObj.GetInt("CourseId"),
IsQuerySurplus=base.ParmJObj.GetInt("IsQuerySurplus"),
};
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
......@@ -143,6 +144,7 @@ namespace Edu.WebApi.Controllers.Course
qitem.ClassId,
qitem.ClassName,
qitem.ClassHours,
qitem.CourseName,
OpenTime = Common.ConvertHelper.FormatDate(qitem.OpenTime)
}));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment