Commit 55bece28 authored by 吴春's avatar 吴春

提交代码

parent c2ef2ebb
......@@ -346,7 +346,7 @@ namespace Mall.WebApi.Controllers.Education
{
return ApiResult.Failed("约课总时长必须课时时长的整数倍");
}
if (courseModel.IsPublic==1)
if (courseModel.IsPublic == 1)
{
//判断时长是否一致
if (query.StudyDuration != courseModel.StudyDuration)
......@@ -394,7 +394,7 @@ namespace Mall.WebApi.Controllers.Education
courseModel.StudyStartTime = Convert.ToDateTime(courseModel.StudyDate.ToString("yyyy-MM-dd") + " " + courseModel.StudyStartDate);
if (courseModel.StudentNumType == Common.Enum.Point.StudentNumTypeEnum.OneToMany)//一对多的时候判断开始时间是否和课程一样
{
if (courseModel.StudyDate != courseModel.StudyStartTime)
if (query.StudyDate != courseModel.StudyStartTime)
{
return ApiResult.Failed("预约时间与课程时间不一致");
}
......@@ -437,18 +437,29 @@ namespace Mall.WebApi.Controllers.Education
{
endTime = item.StudyDate.AddMinutes(Convert.ToDouble(item.TotalStudyDuration));
}
if (query.StudyDate == item.StudyDate)
{
return ApiResult.Failed("当前预约时间已预约");
}
//if (query.StudyDate == item.StudyDate)
//{
// return ApiResult.Failed("当前预约时间已预约");
//}
//if (pointModule.GetTimeSpan(query.StudyDate, item.StudyDate.ToString("HH:mm"), endTime.ToString("HH:mm")))
//{
// return ApiResult.Failed("当前预约时间已预约");
//}
//if (pointModule.GetTimeSpan(nowOrderDate, item.StudyDate.ToString("HH:mm"), endTime.ToString("HH:mm")))
//{
// return ApiResult.Failed("当前预约时间已预约");
//}
if (pointModule.GetTimeSpan(query.StudyDate, item.StudyDate.ToString("HH:mm"), endTime.ToString("HH:mm")))
{
return ApiResult.Failed("当前预约时间已预约");
}
if (pointModule.GetTimeSpan(nowOrderDate, item.StudyDate.ToString("HH:mm"), endTime.ToString("HH:mm")))
if (pointModule.GetTimeSpan(item.StudyDate, query.StudyDate.ToString("HH:mm"), nowOrderDate.ToString("HH:mm")))
{
return ApiResult.Failed("当前预约时间已预约");
}
}
}
......@@ -544,7 +555,7 @@ namespace Mall.WebApi.Controllers.Education
courseModel.StudyStartTime = Convert.ToDateTime(courseModel.StudyDate.ToString("yyyy-MM-dd") + " " + courseModel.StudyStartDate);
if (courseModel.StudentNumType == Common.Enum.Point.StudentNumTypeEnum.OneToMany)//一对多的时候判断开始时间是否和课程一样
{
if (courseModel.StudyDate != courseModel.StudyStartTime)
if (query.StudyDate != courseModel.StudyStartTime)
{
return ApiResult.Failed("预约时间与课程时间不一致");
}
......@@ -587,21 +598,29 @@ namespace Mall.WebApi.Controllers.Education
{
endTime = item.StudyDate.AddMinutes(Convert.ToDouble(item.TotalStudyDuration));
}
if (query.StudyDate == item.StudyDate)
{
return ApiResult.Failed("当前预约时间已预约");
}
if (pointModule.GetTimeSpan(query.StudyDate, item.StudyDate.ToString("HH:mm"), endTime.ToString("HH:mm")))
{
return ApiResult.Failed("当前预约时间已预约");
}
if (pointModule.GetTimeSpan(nowOrderDate, item.StudyDate.ToString("HH:mm"), endTime.ToString("HH:mm")))
if (pointModule.GetTimeSpan(item.StudyDate, query.StudyDate.ToString("HH:mm"), nowOrderDate.ToString("HH:mm")))
{
return ApiResult.Failed("当前预约时间已预约");
}
//if (query.StudyDate == item.StudyDate)
//{
// return ApiResult.Failed("当前预约时间已预约");
//}
//if (pointModule.GetTimeSpan(query.StudyDate, item.StudyDate.ToString("HH:mm"), endTime.ToString("HH:mm")))
//{
// return ApiResult.Failed("当前预约时间已预约");
//}
//if (pointModule.GetTimeSpan(nowOrderDate, item.StudyDate.ToString("HH:mm"), endTime.ToString("HH:mm")))
//{
// return ApiResult.Failed("当前预约时间已预约");
//}
}
}
return ApiResult.Success("当前时间课预约");
return ApiResult.Success("");
}
}
......@@ -837,7 +856,7 @@ namespace Mall.WebApi.Controllers.Education
model.DurationUnit,
model.StudentNumType,
StudyDateStr = model.StudyDate.ToString("yyyy-MM-dd"),
model.StudyStartDate,
model.StudyStartDate,
model.StudyEndDate,
orderList,
StudentNumTypeName = EnumHelper.GetEnumName(model.StudentNumType)
......
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