Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
ac0bf1b8
Commit
ac0bf1b8
authored
Jan 11, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
e0fd2517
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
15 deletions
+28
-15
ChapterTree_ViewModel.cs
Edu.Model/ViewModel/Course/ChapterTree_ViewModel.cs
+11
-0
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+15
-13
MenuModule.cs
Edu.Module.System/MenuModule.cs
+2
-2
No files found.
Edu.Model/ViewModel/Course/ChapterTree_ViewModel.cs
View file @
ac0bf1b8
...
...
@@ -40,5 +40,16 @@ namespace Edu.Model.ViewModel.Course
/// 下级列表
/// </summary>
public
List
<
ChapterTree_ViewModel
>
ChildList
{
get
;
set
;
}
/// <summary>
/// 开发状态(1-开放,2-定时开放)
/// </summary>
public
int
OpenStatus
{
get
;
set
;
}
/// <summary>
/// 章节进度
/// </summary>
public
int
Progress
{
get
;
set
;
}
}
}
Edu.Module.Course/CourseModule.cs
View file @
ac0bf1b8
...
...
@@ -107,7 +107,7 @@ namespace Edu.Module.Course
/// <returns></returns>
public
RB_Course_ViewModel
GetCourseModule
(
object
CourseId
)
{
var
extModel
=
courseRepository
.
GetEntity
<
RB_Course_ViewModel
>(
CourseId
);
var
extModel
=
courseRepository
.
GetEntity
<
RB_Course_ViewModel
>(
CourseId
);
if
(
extModel
!=
null
&&
extModel
.
CourseId
>
0
)
{
var
stepPriceList
=
course_StepPriceRepository
.
GetCourseStepPriceListRepository
(
new
RB_Course_StepPrice_ViewModel
()
...
...
@@ -131,7 +131,7 @@ namespace Edu.Module.Course
model
.
RenewOgPrice
=
0
;
model
.
RenewSlPrice
=
0
;
}
if
(
model
.
CourseId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
...
...
@@ -170,7 +170,7 @@ namespace Edu.Module.Course
}
else
//开启阶梯价格
{
var
oldStepPriceList
=
course_StepPriceRepository
.
GetCourseStepPriceListRepository
(
new
RB_Course_StepPrice_ViewModel
()
{
CourseId
=
model
.
CourseId
});
var
oldStepPriceList
=
course_StepPriceRepository
.
GetCourseStepPriceListRepository
(
new
RB_Course_StepPrice_ViewModel
()
{
CourseId
=
model
.
CourseId
});
//以前没有阶梯报价信息【直接新增】
if
(
oldStepPriceList
==
null
||
(
oldStepPriceList
!=
null
&&
oldStepPriceList
.
Count
==
0
))
{
...
...
@@ -374,19 +374,19 @@ namespace Edu.Module.Course
return
treeList
;
}
/// <summary>
/// 递归遍历所有章节
/// </summary>
/// <param name="sourceList">源数据</param>
/// <param name="parentId">父节点编号</param>
/// <returns></returns>
public
List
<
ChapterTree_ViewModel
>
GetChapterChild
(
List
<
RB_Course_Chapter_ViewModel
>
sourceList
,
int
parentId
)
/// <summary>
/// 递归遍历所有章节
/// </summary>
/// <param name="sourceList">源数据</param>
/// <param name="parentId">父节点编号</param>
/// <returns></returns>
public
List
<
ChapterTree_ViewModel
>
GetChapterChild
(
List
<
RB_Course_Chapter_ViewModel
>
sourceList
,
int
parentId
)
{
List
<
ChapterTree_ViewModel
>
resultList
=
new
List
<
ChapterTree_ViewModel
>();
//获取下级节点
var
subList
=
sourceList
?.
Where
(
qItem
=>
qItem
.
ParentId
==
parentId
).
OrderBy
(
qitem
=>
qitem
.
SortNum
).
ToList
();
var
subList
=
sourceList
?.
Where
(
qItem
=>
qItem
.
ParentId
==
parentId
).
OrderBy
(
qitem
=>
qitem
.
SortNum
).
ToList
();
//如果存在下级节点
if
(
subList
!=
null
&&
subList
.
Count
>
0
)
if
(
subList
!=
null
&&
subList
.
Count
>
0
)
{
foreach
(
var
childItem
in
subList
)
{
...
...
@@ -398,7 +398,9 @@ namespace Edu.Module.Course
ChapterName
=
childItem
.
ChapterName
,
ChapterNo
=
childItem
.
ChapterNo
,
CourseId
=
childItem
.
CourseId
,
ChildList
=
new
List
<
ChapterTree_ViewModel
>()
ChildList
=
new
List
<
ChapterTree_ViewModel
>(),
OpenStatus
=
childItem
.
OpenStatus
,
Progress
=
childItem
.
Progress
};
childModel
.
ChildList
.
AddRange
(
GetChapterChild
(
sourceList
,
childItem
.
ChapterId
));
resultList
.
Add
(
childModel
);
...
...
Edu.Module.System/MenuModule.cs
View file @
ac0bf1b8
...
...
@@ -194,7 +194,7 @@ namespace Edu.Module.System
var
secondLevelList
=
list
.
Where
(
qitem
=>
qitem
.
MenuLevel
==
2
&&
qitem
.
ParentId
==
fItem
.
MenuId
).
ToList
();
if
(
secondLevelList
!=
null
&&
secondLevelList
.
Count
>
0
)
{
foreach
(
var
sItem
in
secondLevelList
)
foreach
(
var
sItem
in
secondLevelList
.
OrderBy
(
qitem
=>
qitem
.
SortNum
)
)
{
MenuTree_ViewModel
sModel
=
new
MenuTree_ViewModel
()
{
...
...
@@ -210,7 +210,7 @@ namespace Edu.Module.System
var
thirdLevelList
=
list
.
Where
(
qitem
=>
qitem
.
MenuLevel
==
3
&&
qitem
.
ParentId
==
sItem
.
MenuId
).
ToList
();
if
(
thirdLevelList
!=
null
&&
thirdLevelList
.
Count
>
0
)
{
foreach
(
var
tItem
in
thirdLevelList
)
foreach
(
var
tItem
in
thirdLevelList
.
OrderBy
(
qitem
=>
qitem
.
SortNum
)
)
{
sModel
.
SubList
.
Add
(
new
MenuTree_ViewModel
()
{
...
...
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