Commit ec649301 authored by 黄奎's avatar 黄奎

页面修改

parent 2010bc0c
using Edu.Model.Entity.Course;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.Entity.Course;
using System;
using System.Collections.Generic;
using System.Text;
......
using Edu.Common;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Mall;
using Edu.Model.ViewModel.User;
using System;
......@@ -158,5 +159,16 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public List<RB_Goods_Category_Extend> CategoryList { get; set; }
/// <summary>
/// 课程等级
/// </summary>
public string CourseRateName { get { return this.CourseRate.ToName(); } }
/// <summary>
/// 所属科目名称
/// </summary>
public string CourseSubjectName { get { return this.CourseSubject.ToName(); } }
}
}
\ No newline at end of file
using Edu.Model.Entity.Grade;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.Entity.Grade;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
......@@ -247,6 +249,16 @@ namespace Edu.Model.ViewModel.Grade
/// 开班时间
/// </summary>
public List<string> ClassDateList { get; set; }
/// <summary>
/// 所属科目
/// </summary>
public CourseSubjectEnum CourseSubject { get; set; }
/// <summary>
/// 科目名称
/// </summary>
public string CourseSubjectName { get { return this.CourseSubject.ToName(); } }
}
/// <summary>
......
using Edu.Model.Entity.Sell;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.Entity.Sell;
using Edu.Model.ViewModel.Contract;
using System;
using System.Collections.Generic;
......@@ -242,5 +244,15 @@ namespace Edu.Model.ViewModel.Sell
/// 订单拆分列表
/// </summary>
public List<RB_Order_SplitDetails_ViewModel> SplitDetailsList { get; set; }
/// <summary>
/// 所属科目
/// </summary>
public CourseSubjectEnum CourseSubject { get; set; }
/// <summary>
/// 科目名称
/// </summary>
public string CourseSubjectName { get { return this.CourseSubject.ToName(); } }
}
}
\ No newline at end of file
......@@ -77,6 +77,11 @@ WHERE 1=1
builder.AppendFormat(" AND ({0}) ", str);
}
}
//所属科目
if (query.CourseSubject > 0)
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_ViewModel.CourseSubject), (int)query.CourseSubject);
}
}
return Get<RB_Course_ViewModel>(builder.ToString(), parameters).ToList();
}
......@@ -144,6 +149,11 @@ WHERE 1=1
builder.AppendFormat(" AND ({0}) ", str);
}
}
//所属科目
if (query.CourseSubject > 0)
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Course_ViewModel.CourseSubject), (int)query.CourseSubject);
}
}
return GetPage<RB_Course_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
......
......@@ -214,7 +214,7 @@ WHERE 1=1
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.CourseName,C.AssistName,IFNULL(C.AssistIcon,'') AS AssistIcon,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead
,E.SName AS SchoolName,IFNULL(F.RoomName,'') AS RoomName,plan.TotalPlanNum,ySplan.UsePlanNum
,E.SName AS SchoolName,IFNULL(F.RoomName,'') AS RoomName,plan.TotalPlanNum,ySplan.UsePlanNum,B.CourseSubject
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN rb_assist AS C ON A.Assist_Id=C.AId
LEFT JOIN rb_teacher AS D ON A.Teacher_Id=D.TId
......@@ -291,6 +291,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND D.{0}={1} ", nameof(RB_Teacher_ViewModel.TId), query.Teacher_Id);
}
if (query.CourseSubject > 0)
{
builder.AppendFormat(" AND B.{0}={1} ", nameof(RB_Class_ViewModel.CourseSubject), (int)query.CourseSubject);
}
}
return GetPage<RB_Class_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
......@@ -331,6 +335,7 @@ WHERE A.ClassId={0}
builder.AppendFormat(@"
SELECT A.*,B.CourseName,B.CourseFeature,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead,E.SName AS SchoolName,R.RoomName
,IFNULL(t.GuestNum,0) AS OrderStudentCount,IFNULL(B.SellPrice,0) AS CourseSellPrice,IFNULL(B.OriginalPrice,0) AS CourseOriginalPrice
,B.CourseSubject
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN rb_teacher AS D ON A.Teacher_Id=D.TId
LEFT JOIN rb_class_room AS R ON A.ClassRoomId=R.RoomId
......@@ -346,6 +351,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.Group_Id), query.Group_Id);
}
if (query.CourseSubject > 0)
{
builder.AppendFormat(" AND B.{0}={1} ", nameof(RB_Class_ViewModel.CourseSubject), (int)query.CourseSubject);
}
if (query.School_Id > -1)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Class_ViewModel.School_Id), query.School_Id);
......
......@@ -252,6 +252,10 @@ ORDER BY {orderBy}
{
where += $@" and o.{nameof(RB_Order_ViewModel.HelpEnterId)} = {demodel.HelpEnterId}";
}
if (demodel.CourseSubject > 0)
{
where += $@" and course.{nameof(RB_Order_ViewModel.CourseSubject)} = {(int)demodel.CourseSubject}";
}
string orderBy = " o.OrderId asc";
if (demodel.Q_OrderBy == 1)
{
......@@ -263,7 +267,8 @@ ORDER BY {orderBy}
}
string sql = $@"
select o.*,c.ClassName,c.ClassNo,c.School_Id as ClassSchoolId,t.TeacherName,t.TeacherIcon,IFNULL(course.CourseName,'') AS CourseName,C.OpenTime
select o.*,c.ClassName,c.ClassNo,c.School_Id as ClassSchoolId,t.TeacherName,t.TeacherIcon,IFNULL(course.CourseName,'') AS CourseName
,C.OpenTime,course.CourseSubject
from RB_Order o
left join rb_class c on o.ClassId = c.ClassId
left join rb_teacher t on c.Teacher_Id = t.TId
......@@ -364,18 +369,24 @@ where {where} order by {orderBy}
{
where += $@" and o.{nameof(RB_Order_ViewModel.PreferPrice)} > (o.{nameof(RB_Order_ViewModel.Income)} - o.{nameof(RB_Order_ViewModel.Refund)} + o.{nameof(RB_Order_ViewModel.PlatformTax)} + o.{nameof(RB_Order_ViewModel.DiscountMoney)}) ";
}
}
string sql = $@" select SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice,
SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income,
SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice - o.Income + o.Refund - o.DiscountMoney - o.PlatformTax ELSE 0 END) AS DueInMoney,
SUM(CASE WHEN o.OrderState <> 3 THEN o.GuestNum ELSE 0 END) AS GuestNum,
SUM(CASE WHEN o.OrderState = 3 THEN o.GuestNum ELSE 0 END) AS CancelNum,
SUM(CASE WHEN o.CommissionMoney <> -1 AND o.OrderState <> 3 THEN o.CommissionMoney ELSE 0 END) AS CommissionMoney,
SUM(CASE WHEN o.OrderState <> 3 THEN o.ExtraRewardMoney - o.ExtraDeductMoney ELSE 0 END) AS ExtraRewardMoney
from RB_Order o
left join rb_class c on o.ClassId = c.ClassId
where {where}
if (demodel.CourseSubject > 0)
{
where += $@" and course.{nameof(RB_Order_ViewModel.CourseSubject)} = {(int)demodel.CourseSubject}";
}
string sql = $@"
SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice,
SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income,
SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice - o.Income + o.Refund - o.DiscountMoney - o.PlatformTax ELSE 0 END) AS DueInMoney,
SUM(CASE WHEN o.OrderState <> 3 THEN o.GuestNum ELSE 0 END) AS GuestNum,
SUM(CASE WHEN o.OrderState = 3 THEN o.GuestNum ELSE 0 END) AS CancelNum,
SUM(CASE WHEN o.CommissionMoney <> -1 AND o.OrderState <> 3 THEN o.CommissionMoney ELSE 0 END) AS CommissionMoney,
SUM(CASE WHEN o.OrderState <> 3 THEN o.ExtraRewardMoney - o.ExtraDeductMoney ELSE 0 END) AS ExtraRewardMoney
FROM RB_Order o LEFT JOIN rb_class c on o.ClassId = c.ClassId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
WHERE {where}
";
return Get<RB_Order_ViewModel>(sql).FirstOrDefault();
}
......
......@@ -54,7 +54,8 @@ namespace Edu.WebApi.Controllers.Course
School_Id = base.ParmJObj.GetInt("School_Id"),
TeacherName = base.ParmJObj.GetStringValue("TeacherName"),
CourseName = base.ParmJObj.GetStringValue("CourseName"),
ClassNo = base.ParmJObj.GetStringValue("ClassNo")
ClassNo = base.ParmJObj.GetStringValue("ClassNo"),
CourseSubject=(CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
......@@ -94,6 +95,8 @@ namespace Edu.WebApi.Controllers.Course
item.FinishTimeStr,
item.UsePlanNum,
item.TotalPlanNum,
item.CourseSubject,
item.CourseSubjectName,
});
}
pageModel.Count = rowsCount;
......
......@@ -191,6 +191,7 @@ namespace Edu.WebApi.Controllers.Course
IsQPrice = base.ParmJObj.GetInt("IsQPrice"),
IsQTeacher = base.ParmJObj.GetInt("IsQTeacher"),
Saleplat = base.ParmJObj.GetStringValue("Saleplat"),
CourseSubject=(CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
query.Group_Id = base.UserInfo.Group_Id;
//query.School_Id = base.UserInfo.School_Id;
......@@ -223,6 +224,7 @@ namespace Edu.WebApi.Controllers.Course
var query = new RB_Course_ViewModel()
{
IsQPrice = base.ParmJObj.GetInt("IsQPrice", 0),
CourseSubject=(CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
......
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.Sale;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
......
......@@ -51,7 +51,8 @@ namespace Edu.WebApi.Controllers.Course
CouseId = base.ParmJObj.GetInt("CouseId"),
Q_CanApply = base.ParmJObj.GetInt("Q_CanApply"),
JoinStartTime = base.ParmJObj.GetStringValue("JoinStartTime"),
JoinEndTime = base.ParmJObj.GetStringValue("JoinEndTime")
JoinEndTime = base.ParmJObj.GetStringValue("JoinEndTime"),
CourseSubject=(CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
dmodel.School_Id = -1;
var schoolId = base.ParmJObj.GetStringValue("School_Id");
......@@ -112,6 +113,8 @@ namespace Edu.WebApi.Controllers.Course
UpdateTime = Common.ConvertHelper.FormatTime(x.UpdateTime),
x.OtherCourseList,
IsChaBan = IsInsertClass,
x.CourseSubject,
x.CourseSubjectName,
};
result.Add(obj);
}
......@@ -1237,6 +1240,7 @@ namespace Edu.WebApi.Controllers.Course
Q_OrderState = base.ParmJObj.GetInt("Q_OrderState"),
Q_OrderBy = base.ParmJObj.GetInt("Q_OrderBy"),
PlatformTax = base.ParmJObj.GetDecimal("PlatformTax"),
CourseSubject=(CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
demodel.Group_Id = userInfo.Group_Id;
demodel.EnterID = userInfo.Id;
......@@ -1322,6 +1326,8 @@ namespace Edu.WebApi.Controllers.Course
x.RenewOrderId,
x.FirstOrderId,
x.IsBackClass,
x.CourseSubject,
x.CourseSubjectName,
SplitDetailsList = x?.SplitDetailsList?.Select(qitem => new
{
qitem.S_ClassId,
......@@ -1418,7 +1424,8 @@ namespace Edu.WebApi.Controllers.Course
PlatformTax = base.ParmJObj.GetDecimal("PlatformTax"),
EnterID = base.ParmJObj.GetInt("EnterID"),
HelpEnterId = base.ParmJObj.GetInt("HelpEnterId", 0),
ClassNo = base.ParmJObj.GetStringValue("ClassNo")
ClassNo = base.ParmJObj.GetStringValue("ClassNo"),
CourseSubject=(CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
demodel.Group_Id = userInfo.Group_Id;
......@@ -1503,6 +1510,8 @@ namespace Edu.WebApi.Controllers.Course
x.RenewOrderId,
x.FirstOrderId,
x.IsBackClass,
x.CourseSubject,
x.CourseSubjectName,
SplitDetailsList = x?.SplitDetailsList?.Select(qitem => new
{
qitem.S_ClassId,
......
......@@ -53,6 +53,7 @@ namespace Edu.WebApi.Controllers.Course
School_Id = base.ParmJObj.GetInt("School_Id"),
TeacherName = base.ParmJObj.GetStringValue("TeacherName"),
CourseName = base.ParmJObj.GetStringValue("CourseName"),
CourseSubject = (CourseSubjectEnum)base.ParmJObj.GetInt("CourseSubject"),
};
query.Group_Id = base.UserInfo.Group_Id;
List<object> result = new List<object>();
......@@ -91,6 +92,8 @@ namespace Edu.WebApi.Controllers.Course
item.CouseId,
item.FinishTimeStr,
item.OrderStudentCount,
item.CourseSubject,
item.CourseSubjectName,
});
}
pageModel.Count = rowsCount;
......
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