Commit 9c6f6bc2 authored by 黄奎's avatar 黄奎

页面修改

parent 209ee752
......@@ -57,10 +57,12 @@ namespace Edu.Model.ViewModel.Course
/// 班级对应的老师id
/// </summary>
public int Teacher_Id { get; set; }
/// <summary>
/// 教师ids
/// </summary>
public string Q_TeacherIds { get; set; }
/// <summary>
/// 上课开始时间
/// </summary>
......@@ -69,5 +71,10 @@ namespace Edu.Model.ViewModel.Course
/// 上课结束时间
/// </summary>
public string EndTime { get; set; }
/// <summary>
/// 上课日期【查询使用】
/// </summary>
public string QClassDateStr { get; set; }
}
}
......@@ -1071,6 +1071,7 @@ namespace Edu.Module.Course
{
return class_PlanRepository.GetClassPlanModelRepository(query);
}
/// <summary>
/// 获取每天签到记录
/// </summary>
......
......@@ -233,8 +233,10 @@ LEFT JOIN rb_teacher as c on c.TId=a.TeacherId
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" SELECT a.* from rb_class_plan as a
where a.`Status`=0 and DATE_FORMAT(a.ClassDate,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d') ");
builder.AppendFormat(@"
SELECT a.*
FROM rb_class_plan as a
WHERE a.`Status`=0 ");
if (query != null)
{
if (query.Group_Id > 0)
......@@ -253,8 +255,16 @@ LEFT JOIN rb_teacher as c on c.TId=a.TeacherId
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_Plan_ViewModel.Status), (int)query.Status);
}
if (!string.IsNullOrEmpty(query.QClassDateStr))
{
builder.AppendFormat(@" AND DATE_FORMAT(a.ClassDate,'%Y-%m-%d')=DATE_FORMAT('{0}','%Y-%m-%d') ", query.QClassDateStr);
}
else
{
builder.AppendFormat(@" AND DATE_FORMAT(a.ClassDate,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d') ");
}
}
builder.AppendFormat(@" order by ClassDate desc ");
builder.AppendFormat(@" ORDER BY ClassDate DESC ");
return Get<RB_Class_Plan_ViewModel>(builder.ToString()).ToList();
}
......
......@@ -601,7 +601,12 @@ namespace Edu.WebApi.Controllers.Course
}
//判断今天有课没有
var planList = classModule.GetClassPlanModelRepository(new RB_Class_Plan_ViewModel { Group_Id = base.UserInfo.Group_Id, ClassId = list.FirstOrDefault().ClassId });
var planList = classModule.GetClassPlanModelRepository(new RB_Class_Plan_ViewModel
{
Group_Id = base.UserInfo.Group_Id,
ClassId = list.FirstOrDefault().ClassId,
QClassDateStr = Common.ConvertHelper.FormatDate(list.FirstOrDefault().ClassDate),
});
if (planList == null || !planList.Any())
{
return ApiResult.Failed("今日无课程,无须签到");
......
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