Commit dbed0067 authored by 吴春's avatar 吴春

提交代码

parent 52ff59e2
...@@ -22,6 +22,10 @@ namespace Mall.Model.Entity.Point ...@@ -22,6 +22,10 @@ namespace Mall.Model.Entity.Point
public int CourseClassId { get; set; } public int CourseClassId { get; set; }
/// <summary>
/// 课程名称
/// </summary>
public string CourseName { get; set; }
/// <summary> /// <summary>
/// 课程Id /// 课程Id
/// </summary> /// </summary>
...@@ -34,8 +38,9 @@ namespace Mall.Model.Entity.Point ...@@ -34,8 +38,9 @@ namespace Mall.Model.Entity.Point
/// </summary> /// </summary>
public int TeacherId { get; set; } public int TeacherId { get; set; }
/// <summary>
/// 用户id
/// </summary>
public int UserId { get; set; } public int UserId { get; set; }
......
...@@ -22,6 +22,7 @@ namespace Mall.Module.Education ...@@ -22,6 +22,7 @@ namespace Mall.Module.Education
private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository(); private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository();
private readonly RB_Point_CourseClassRepository pointCourseClassRepository = new RB_Point_CourseClassRepository(); private readonly RB_Point_CourseClassRepository pointCourseClassRepository = new RB_Point_CourseClassRepository();
private readonly RB_Point_TeacherCourseRepository pointTeacherCourseRepository = new RB_Point_TeacherCourseRepository(); private readonly RB_Point_TeacherCourseRepository pointTeacherCourseRepository = new RB_Point_TeacherCourseRepository();
private readonly RB_Point_TeacherCourseOrderRepository pointTeacherCourseOrderRepository = new RB_Point_TeacherCourseOrderRepository();
#region 点数商品 #region 点数商品
...@@ -320,7 +321,8 @@ namespace Mall.Module.Education ...@@ -320,7 +321,8 @@ namespace Mall.Module.Education
/// </summary> /// </summary>
/// <param name="userId"></param> /// <param name="userId"></param>
/// <returns></returns> /// <returns></returns>
public int GetUserPointBalance(int userId) { public int GetUserPointBalance(int userId)
{
return member_UserRepository.GetEntity(userId)?.PointNum ?? 0; return member_UserRepository.GetEntity(userId)?.PointNum ?? 0;
} }
#endregion #endregion
...@@ -557,5 +559,71 @@ namespace Mall.Module.Education ...@@ -557,5 +559,71 @@ namespace Mall.Module.Education
} }
#endregion #endregion
#region 订单
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_TeacherCourseOrder_Extend> GetPointOrderList(RB_Point_TeacherCourseOrder_Extend where)
{
return pointTeacherCourseOrderRepository.GetPointOrderList(where);
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_TeacherCourseOrder_Extend> GetPointOrderPageList(int pageIndex, int pageSize, out long rowsCount, RB_Point_TeacherCourseOrder_Extend where)
{
return pointTeacherCourseOrderRepository.GetPointOrderPageList(pageIndex, pageSize, out rowsCount, where);
}
public bool SetTeacherCourseOrder(RB_Point_TeacherCourseOrder_Extend model)
{
bool flag = false;
var trans = pointTeacherCourseOrderRepository.DbTransaction;
var umodel = member_UserRepository.GetEntity(model.UserId);
if (umodel == null)
{
return false;
}
int orderId = 0;
if (model.ID == 0)
{
orderId = pointTeacherCourseOrderRepository.Insert(model, trans);
}
else
{
orderId = model.ID;
}
RB_Member_PointBalance_Extend memberBalanceModel = new RB_Member_PointBalance_Extend
{
UserId = model.UserId,
Type = Common.Enum.MarketingCenter.RecordTypeEnum.Income,
PonitNum = model.TotalPointNum,
Description = "购买直播课程消费" + model.TotalPointNum + "点",
CreateDate = System.DateTime.Now,
TenantId = model.TenantId,
MallBaseId = model.MallBaseId,
Remarks = "上课时间:" + model.StudyDate.ToString("yyyy-MM-dd HH:mm") + "时长" + model.TotalStudyDuration.ToString("f2") + Common.Plugin.EnumHelper.GetEnumName(model.DurationUnit) ,
PlatformType = umodel.Source
};
memberPointBalanceRepository.Insert(memberBalanceModel, trans);
return flag;
}
#endregion
} }
} }
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