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

新增关联

parent b71e52c3
......@@ -487,6 +487,11 @@ namespace Mall.Model.Extend.Product
/// 讲义价格
/// </summary>
public decimal BookPrice { get; set; }
/// <summary>
/// 班级报名条件
/// </summary>
public List<ClassConditionItem> ClassCondition { get; set; }
}
public class CourseTimeItem
......@@ -506,4 +511,40 @@ namespace Mall.Model.Extend.Product
/// </summary>
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,27 +700,62 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
jsonItem.EndOrderTime = jObj.GetStringValue("EndOrderTime");
jsonItem.BookPrice = jObj.GetDecimal("BookPrice");
jsonItem.ClassTimeList = new List<CourseTimeItem>();
var tempArray = JArray.Parse(jObj.GetStringValue("ClassTimeList"));
try
jsonItem.ClassCondition = new List<ClassConditionItem>();
string classTimeStr = jObj.GetStringValue("ClassTimeList");
if (!string.IsNullOrEmpty(classTimeStr))
{
if (tempArray != null && tempArray.Count > 0)
try
{
foreach (var tItem in tempArray)
var tempArray = JArray.Parse(classTimeStr);
if (tempArray != null && tempArray.Count > 0)
{
JObject subObj = JObject.Parse(JsonHelper.Serialize(tItem));
jsonItem.ClassTimeList.Add(new CourseTimeItem()
foreach (var tItem in tempArray)
{
TypeStr = subObj.GetStringValue("TypeStr"),
TimeStr = subObj.GetStringValue("TimeStr"),
DateList = JsonHelper.DeserializeObject<List<string>>(subObj.GetStringValue("DateList")),
});
JObject subObj = JObject.Parse(JsonHelper.Serialize(tItem));
jsonItem.ClassTimeList.Add(new CourseTimeItem()
{
TypeStr = subObj.GetStringValue("TypeStr"),
TimeStr = subObj.GetStringValue("TimeStr"),
DateList = JsonHelper.DeserializeObject<List<string>>(subObj.GetStringValue("DateList")),
});
}
}
}
catch
{
}
}
catch
{
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
......
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