Commit b46e61a0 authored by 吴春's avatar 吴春

提交代码

parent 7814ee30
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Plugin;
namespace Mall.Common.Enum.Point
{
public enum CourseClassTypeEnum
{
/// <summary>
/// 体验课
/// </summary>
[EnumField("体验课")]
Experience = 1,
/// <summary>
/// 一对一外教
/// </summary>
[EnumField("一对一外教")]
OneForeignTeacher = 2,
/// <summary>
/// 一对一中教
/// </summary>
[EnumField("一对一中教")]
OneTeacher = 3,
/// <summary>
/// 公开课
/// </summary>
[EnumField("公开课")]
Public = 24,
/// <summary>
/// 兴趣主题课
/// </summary>
[EnumField("兴趣主题课")]
InterestTopics =5
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Plugin;
namespace Mall.Common.Enum.Point
{
public enum DurationUnitEnum
{
/// <summary>
/// 分钟
/// </summary>
[EnumField("分钟")]
Minute = 1,
/// <summary>
/// 小时
/// </summary>
[EnumField("小时")]
Hour = 2
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Common.Enum.Point;
using VT.FW.DB;
namespace Mall.Model.Entity.Point
{
/// <summary>
/// 排课分类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Point_CourseClass
{
public int ID { get; set; }
/// <summary>
/// 排序
/// </summary>
public int? Sort
{
get;
set;
}
/// <summary>
/// 分类类型
/// </summary>
public CourseClassTypeEnum CourseClassType { get; set; }
/// <summary>
/// 上课人数
/// </summary>
public int StudentNumType { get; set; }
/// <summary>
/// 是否为公开课0-否,1-是
/// </summary>
public int IsPublic { get; set; }
/// <summary>
/// 是否免费0-否,1-是
/// </summary>
public int IsFree { get; set; }
/// <summary>
/// 点数
/// </summary>
public int PointNum { get; set; }
/// <summary>
/// 多少时长
/// </summary>
public int Duration { get; set; }
/// <summary>
/// 时长单位
/// </summary>
public DurationUnitEnum DurationUnit { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int? State
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// UpdateDate
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Point;
namespace Mall.Model.Extend.Point
{
/// <summary>
/// 课程分类扩展表
/// </summary>
public class RB_Point_CourseClass_Extend : RB_Point_CourseClass
{
/// <summary>
/// 分类名称
/// </summary>
public string ClassName { get; set; }
}
}
......@@ -20,6 +20,8 @@ namespace Mall.Module.Education
/// 会员信息
/// </summary>
private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository();
private readonly RB_Point_CourseClassRepository pointCourseClassRepository = new RB_Point_CourseClassRepository();
#region 点数商品
/// <summary>
/// 获取列表
......@@ -65,7 +67,7 @@ namespace Mall.Module.Education
{
{ nameof(RB_Point_Goods_Extend.UpdateDate), model.UpdateDate },
{ nameof(RB_Point_Goods_Extend.GoodsName), model.GoodsName },
{ nameof(RB_Point_Goods_Extend.GivePonit), model.GivePonit },
{ nameof(RB_Point_Goods_Extend.GivePoint), model.GivePoint },
{ nameof(RB_Point_Goods_Extend.OriginalPrice), model.OriginalPrice },
{ nameof(RB_Point_Goods_Extend.SellingPrice), model.SellingPrice },
{ nameof(RB_Point_Goods_Extend.Sort), model.Sort },
......@@ -266,7 +268,7 @@ namespace Mall.Module.Education
OperatorEnum = OperatorEnum.Equal
}
};
member_UserRepository.Update(filedsUser, userWhereHelpers, trans);
}
return flag;
}
......@@ -294,6 +296,37 @@ namespace Mall.Module.Education
#endregion
#region 在线课程分类
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_CourseClass_Extend> GetPointCourseClassList(RB_Point_CourseClass_Extend where)
{
return pointCourseClassRepository.GetPointCourseClassList(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_CourseClass_Extend> GetPointCourseClassPageList(int pageIndex, int pageSize, out long rowsCount, RB_Point_CourseClass_Extend where)
{
return pointCourseClassRepository.GetPointCourseClassPageList(pageIndex, pageSize, out rowsCount, where);
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mall.Model.Entity.Point;
using Mall.Model.Extend.Point;
namespace Mall.Repository.Point
{
public class RB_Point_CourseClassRepository:BaseRepository<RB_Point_CourseClass>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Point_CourseClass); } }
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_CourseClass_Extend> GetPointCourseClassList(RB_Point_CourseClass_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_Point_CourseClass where state=0");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
}
if (where.ID > 0)
{
sb.AppendFormat(" and ID={0}", where.ID);
}
}
return Get<RB_Point_CourseClass_Extend>(sb.ToString()).ToList();
}
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="where"></param>
/// <returns></returns>
public List<RB_Point_CourseClass_Extend> GetPointCourseClassPageList(int pageIndex, int pageSize, out long rowsCount, RB_Point_CourseClass_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_Point_CourseClass where state=0");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
}
if (where.ID > 0)
{
sb.AppendFormat(" and ID={0}", where.ID);
}
if (where.CourseClassType > 0)
{
sb.AppendFormat(" and CourseClassType={0}", (int)where.CourseClassType);
}
}
return GetPage<RB_Point_CourseClass_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
}
}
}
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