Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
6b564703
Commit
6b564703
authored
Nov 10, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增关联
parent
b71e52c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
13 deletions
+89
-13
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+41
-0
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+48
-13
No files found.
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
6b564703
...
...
@@ -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
;
}
}
}
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
6b564703
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment