Commit de8feafc authored by 黄奎's avatar 黄奎

页面修改

parent 1454f9e1
......@@ -14,5 +14,10 @@ namespace Edu.Model.ViewModel.Course
/// 课程编号
/// </summary>
public string QCourseIds { get; set; }
/// <summary>
/// 优惠类型字符串
/// </summary>
public string PriceDiscountTypeStr { get { return Common.Plugin.EnumHelper.ToName(this.PriceDiscountType); } }
}
}
using Edu.Common;
using Edu.Model.ViewModel.User;
using System;
using System.Collections.Generic;
......@@ -40,11 +41,31 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public string QCateIds { get; set; }
/// <summary>
/// 是否查询优化价格
/// </summary>
public int IsQPrice { get; set; }
/// <summary>
/// 是否查询老师
/// </summary>
public int IsQTeacher { get; set; }
/// <summary>
/// 课程阶梯价格列表
/// </summary>
public List<RB_Course_StepPrice_ViewModel> StepPriceList { get; set; }
/// <summary>
/// 课程优惠列表
/// </summary>
public List<RB_Course_Preferential_Extend> PreferentialList { get; set; }
/// <summary>
/// 讲师列表
/// </summary>
public List<RB_Teacher_ViewModel> TeacherList { get; set; }
/// <summary>
/// 教师团队
/// </summary>
......@@ -61,7 +82,7 @@ namespace Edu.Model.ViewModel.Course
}
/// <summary>
/// 销售平台
/// 销售平台[修改使用]
/// </summary>
public List<int> SalePlatList
{
......@@ -74,5 +95,35 @@ namespace Edu.Model.ViewModel.Course
return new List<int>();
}
}
/// <summary>
/// 销售平台数组
/// </summary>
public List<string> SalePlatArr
{
get
{
List<string> list = new List<string>();
if (this.SalePlatList != null && this.SalePlatList.Count > 0)
{
foreach (var item in this.SalePlatList)
{
switch (item)
{
case 1:
list.Add("内部销售");
break;
case 2:
list.Add("学员App");
break;
case 3:
list.Add("网课端");
break;
}
}
}
return list;
}
}
}
}
\ No newline at end of file
using Edu.AOP.CustomerAttribute;
using Edu.Common.Enum;
using Edu.Model.ViewModel.Course;
using Edu.Model.ViewModel.User;
using Edu.Repository.Course;
using Edu.Repository.User;
using System.Collections.Generic;
using System.Linq;
using VT.FW.DB;
......@@ -73,6 +75,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Course_PreferentialRepository course_PreferentialRepository = new RB_Course_PreferentialRepository();
/// <summary>
/// 讲师管理仓储层对象
/// </summary>
private readonly RB_TeacherRepository teacherRepository = new RB_TeacherRepository();
#region 课程管理
/// <summary>
......@@ -103,7 +110,43 @@ namespace Edu.Module.Course
query.QCateIds = cateIds;
}
}
return courseRepository.GetCoursePageListRepository(pageIndex, pageSize, out rowsCount, query);
var list =courseRepository.GetCoursePageListRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0 )
{
var ids = string.Join(",", list.Select(qitem => qitem.CourseId));
var preferentialList= new List<RB_Course_Preferential_Extend>();
List<RB_Teacher_ViewModel> teacherList = new List<RB_Teacher_ViewModel>();
if (query.IsQPrice == 1)
{
preferentialList = course_PreferentialRepository.GetCoursePreferentialListRepostory(new RB_Course_Preferential_Extend()
{
QCourseIds = ids
});
}
if (query.IsQTeacher == 1)
{
var teacherids = string.Join(",", list.Where(qitem => !string.IsNullOrEmpty(qitem.Teacher_Ids)).Select(qitem => qitem.Teacher_Ids));
teacherList = teacherRepository.GetTeacherListRepository(new RB_Teacher_ViewModel() { QTIds = teacherids });
}
foreach (var item in list)
{
item.PreferentialList = preferentialList?.Where(qitem => qitem.CourseId == item.CourseId)?.ToList() ?? new List<RB_Course_Preferential_Extend>();
item.TeacherList = new List<RB_Teacher_ViewModel>();
if (item.TeacherIdList != null && item.TeacherIdList.Count > 0)
{
foreach (var subItem in item.TeacherIdList)
{
var teacher = teacherList?.Where(qitem => qitem.TId == subItem)?.FirstOrDefault();
if (teacher != null && teacher.TId > 0)
{
item.TeacherList.Add(teacher);
}
}
}
}
}
return list;
}
/// <summary>
......
......@@ -42,7 +42,7 @@ WHERE 1=1 ");
}
if (!string.IsNullOrEmpty(query.QCourseIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Course_Preferential_Extend.CourseId), query.CourseId);
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Course_Preferential_Extend.CourseId), query.QCourseIds);
}
if (query.Id > 0)
{
......
......@@ -2,6 +2,7 @@
using System.Collections.Generic;
using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum;
using Edu.Common.Enum.Course;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course;
......@@ -153,7 +154,14 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult GetCoursePageList()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_ViewModel>(RequestParm.Msg.ToString());
var query = new RB_Course_ViewModel()
{
CourseName=base.ParmJObj.GetStringValue("CourseName"),
QCateIds=base.ParmJObj.GetStringValue("QCateIds"),
Status=(DateStateEnum)base.ParmJObj.GetInt("Status"),
IsQPrice=base.ParmJObj.GetInt("IsQPrice"),
IsQTeacher=base.ParmJObj.GetInt("IsQTeacher"),
};
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
var list = courseModule.GetCoursePageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......
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