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
ea4c8736
Commit
ea4c8736
authored
Dec 11, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
54986e97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+20
-2
No files found.
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
ea4c8736
...
...
@@ -396,7 +396,25 @@ namespace Edu.WebApi.Controllers.Course
}
}
return
ApiResult
.
Success
(
data
:
new
{
data
.
TeacherName
,
data
.
RoomName
,
TotalHour
=
(
totalMinutes
/
60
).
ToString
(
"f2"
),
ClassNum
=
(
totalMinutes
/
45
).
ToString
(
"f2"
),
ClassDate
=
data
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
)
});
var
orderGuestList
=
classModule
.
GetOrderGuest
(
new
RB_Order_Guest_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
School_Id
=
data
.
School_Id
,
ClassId
=
data
.
ClassId
});
var
checkLogList
=
classModule
.
GetClassCheckListRepository
(
new
RB_Class_Check_ViewModel
{
Group_Id
=
data
.
Group_Id
,
School_Id
=
data
.
School_Id
,
ClassId
=
data
.
ClassId
,
StartDate
=
data
.
ClassDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
EndDate
=
data
.
ClassDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
List
<
object
>
guestList
=
new
List
<
object
>();
foreach
(
var
item
in
orderGuestList
)
{
guestList
.
Add
(
new
{
UserIcon
=
""
,
item
.
Id
,
SexStr
=
item
.
Sex
==
1
?
"男"
:
"女"
,
item
.
GuestName
,
item
.
Age
,
CreateTimeStr
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
CreateTime
),
item
.
Mobile
,
item
.
OrderId
,
IsCheck
=
(
checkLogList
!=
null
&&
checkLogList
.
Any
())
?
checkLogList
.
Where
(
x
=>
x
.
OrderGuestId
==
item
.
Id
).
FirstOrDefault
()?.
CheckStatus
??-
1
:
-
1
});
}
return
ApiResult
.
Success
(
data
:
new
{
data
.
TeacherName
,
data
.
RoomName
,
TotalHour
=
Convert
.
ToInt32
(
totalMinutes
/
60
),
ClassNum
=
Convert
.
ToInt32
(
totalMinutes
/
45
),
ClassDate
=
data
.
ClassDate
.
ToString
(
"yyyy-MM-dd"
),
GuestList
=
guestList
});
}
/// <summary>
...
...
@@ -468,7 +486,7 @@ namespace Edu.WebApi.Controllers.Course
List
<
object
>
resultList
=
new
List
<
object
>();
var
dateList
=
list
.
GroupBy
(
x
=>
new
{
MonthStr
=
x
.
ClassDate
.
ToString
(
"MM"
),
YearStr
=
x
.
ClassDate
.
ToString
(
"yyyy"
)
}).
Select
(
x
=>
new
{
x
.
Key
.
MonthStr
,
x
.
Key
.
YearStr
});
var
dateList
=
list
.
GroupBy
(
x
=>
new
{
MonthStr
=
x
.
ClassDate
.
ToString
(
"MM"
),
YearStr
=
x
.
ClassDate
.
ToString
(
"yyyy"
)
}).
Select
(
x
=>
new
{
x
.
Key
.
MonthStr
,
x
.
Key
.
YearStr
});
foreach
(
var
item
in
list
)
{
int
totalNum
=
checkLogList
.
Where
(
x
=>
x
.
ClassId
==
item
.
ClassId
&&
x
.
ClassRoomId
==
item
.
ClassRoomId
&&
x
.
Group_Id
==
item
.
Group_Id
&&
x
.
School_Id
==
item
.
School_Id
).
Count
();
...
...
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