Commit 6b564703 authored by 黄奎's avatar 黄奎

新增关联

parent b71e52c3
...@@ -487,6 +487,11 @@ namespace Mall.Model.Extend.Product ...@@ -487,6 +487,11 @@ namespace Mall.Model.Extend.Product
/// 讲义价格 /// 讲义价格
/// </summary> /// </summary>
public decimal BookPrice { get; set; } public decimal BookPrice { get; set; }
/// <summary>
/// 班级报名条件
/// </summary>
public List<ClassConditionItem> ClassCondition { get; set; }
} }
public class CourseTimeItem public class CourseTimeItem
...@@ -506,4 +511,40 @@ namespace Mall.Model.Extend.Product ...@@ -506,4 +511,40 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public string TypeStr { get; set; } public string TypeStr { get; set; }
} }
/// <summary>
/// 报名限制条件配置项
/// </summary>
public class ClassConditionItem
{
/// <summary>
/// 班级Id
/// </summary>
public int ClassId { get; set; }
/// <summary>
/// 报名项目编号
/// </summary>
public int ItemId { get; set; }
/// <summary>
/// 报名项目名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 报名限制条例类型
/// </summary>
public int ItemType { get; set; }
/// <summary>
/// 最低分
/// </summary>
public decimal LowScore { get; set; }
/// <summary>
/// 最高分
/// </summary>
public decimal HighScore { get; set; }
}
} }
...@@ -700,9 +700,13 @@ WHERE {where} group by g.Id order by g.CreateDate desc"; ...@@ -700,9 +700,13 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
jsonItem.EndOrderTime = jObj.GetStringValue("EndOrderTime"); jsonItem.EndOrderTime = jObj.GetStringValue("EndOrderTime");
jsonItem.BookPrice = jObj.GetDecimal("BookPrice"); jsonItem.BookPrice = jObj.GetDecimal("BookPrice");
jsonItem.ClassTimeList = new List<CourseTimeItem>(); jsonItem.ClassTimeList = new List<CourseTimeItem>();
var tempArray = JArray.Parse(jObj.GetStringValue("ClassTimeList")); jsonItem.ClassCondition = new List<ClassConditionItem>();
string classTimeStr = jObj.GetStringValue("ClassTimeList");
if (!string.IsNullOrEmpty(classTimeStr))
{
try try
{ {
var tempArray = JArray.Parse(classTimeStr);
if (tempArray != null && tempArray.Count > 0) if (tempArray != null && tempArray.Count > 0)
{ {
foreach (var tItem in tempArray) foreach (var tItem in tempArray)
...@@ -722,6 +726,37 @@ WHERE {where} group by g.Id order by g.CreateDate desc"; ...@@ -722,6 +726,37 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
} }
} }
string conditionStr = jObj.GetStringValue("ClassCondition");
if(!string.IsNullOrEmpty(conditionStr))
{
try
{
var conditionArray = JArray.Parse(conditionStr);
if (conditionArray != null && conditionArray.Count > 0)
{
foreach (var tItem in conditionArray)
{
JObject subObj = JObject.Parse(JsonHelper.Serialize(tItem));
jsonItem.ClassCondition.Add(new ClassConditionItem()
{
ClassId = subObj.GetInt("ClassId"),
ItemId = subObj.GetInt("ItemId"),
ItemName = subObj.GetStringValue("ItemName"),
ItemType = subObj.GetInt("ItemType"),
LowScore = subObj.GetDecimal("LowScore"),
HighScore = subObj.GetDecimal("HighScore"),
});
}
}
}
catch
{
}
}
}
} }
catch catch
{ {
......
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