Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EduSpider
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
viitto
EduSpider
Commits
37235d67
Commit
37235d67
authored
Jun 07, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
0b47df82
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
30 deletions
+45
-30
TeacherController.cs
EduSpider.WebApi/Controllers/Student/TeacherController.cs
+45
-30
No files found.
EduSpider.WebApi/Controllers/Student/TeacherController.cs
View file @
37235d67
...
...
@@ -207,51 +207,66 @@ namespace EduSpider.WebApi.Controllers
CourseName
=
base
.
ReqParameters
.
GetString
(
"CourseName"
),
};
var
courseRuleList
=
CourseService
.
GetCourseCommentList
(
query
).
OrderBy
(
qitem
=>
qitem
.
Times
).
ToList
();
var
sysCommentList
=
CourseService
.
GetSysComment
(
new
CourseQuery
()
{
KeyWords
=
query
.
CourseName
,
CommentTimes
=
query
.
CommentTimes
}).
OrderBy
(
qitem
=>
qitem
.
Times
).
ToList
();
List
<
object
>
result
=
new
();
if
(
courseRuleList
!=
null
&&
courseRuleList
.
Count
>
0
)
for
(
var
i
=
1
;
i
<=
3
;
i
++
)
{
foreach
(
var
item
in
courseRuleList
)
var
tempCourseRule
=
courseRuleList
.
Where
(
qitem
=>
qitem
.
Times
==
i
).
FirstOrDefault
();
var
defaultRule
=
sysCommentList
.
Where
(
qitem
=>
qitem
.
Times
==
i
).
FirstOrDefault
();
int
IsDefault
=
0
;
int
Id
=
0
;
List
<
object
>
SubList
=
new
List
<
object
>();
if
(
tempCourseRule
!=
null
)
{
result
.
Add
(
new
Id
=
tempCourseRule
.
Id
;
if
(
tempCourseRule
.
CommentDetails
!=
null
&&
tempCourseRule
.
CommentDetails
.
Count
>
0
)
{
IsDefault
=
0
,
item
.
Id
,
item
.
Times
,
CommentDetails
=
item
.
CommentDetails
.
Select
(
qitem
=>
new
foreach
(
var
subItem
in
tempCourseRule
.
CommentDetails
)
{
qitem
.
DetailId
,
qitem
.
CourseCommentId
,
qitem
.
StartNum
,
qitem
.
EndNum
,
qitem
.
Info
,
}),
});
SubList
.
Add
(
new
{
subItem
.
DetailId
,
subItem
.
CourseCommentId
,
subItem
.
StartNum
,
subItem
.
EndNum
,
subItem
.
Info
,
});
}
}
}
}
else
{
var
sysCommentList
=
CourseService
.
GetSysComment
(
new
CourseQuery
()
{
KeyWords
=
query
.
CourseName
,
CommentTimes
=
query
.
CommentTimes
}).
OrderBy
(
qitem
=>
qitem
.
Times
).
ToList
();
if
(
sysCommentList
!=
null
&&
sysCommentList
.
Count
>
0
)
else
if
(
defaultRule
!=
null
)
{
foreach
(
var
item
in
sysCommentList
)
Id
=
defaultRule
.
Id
;
IsDefault
=
1
;
if
(
defaultRule
.
Details
!=
null
&&
defaultRule
.
Details
.
Count
>
0
)
{
result
.
Add
(
new
foreach
(
var
subItem
in
defaultRule
.
Details
)
{
IsDefault
=
1
,
item
.
Id
,
item
.
Times
,
CommentDetails
=
item
.
Details
.
Select
(
qitem
=>
new
SubList
.
Add
(
new
{
DetailId
=
0
,
CourseCommentId
=
0
,
qi
tem
.
StartNum
,
qi
tem
.
EndNum
,
qi
tem
.
Info
,
})
,
}
);
subI
tem
.
StartNum
,
subI
tem
.
EndNum
,
subI
tem
.
Info
,
})
;
}
}
}
if
(
Id
>
0
)
{
result
.
Add
(
new
{
IsDefault
,
Id
,
Times
=
i
,
CommentDetails
=
SubList
});
}
}
return
ApiResult
.
Success
(
data
:
result
);
}
...
...
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