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
d204940b
Commit
d204940b
authored
Jun 24, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
0583781f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
RB_Class_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Class_ViewModel.cs
+5
-0
RB_ClassRepository.cs
Edu.Repository/Course/RB_ClassRepository.cs
+8
-2
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+2
-0
No files found.
Edu.Model/ViewModel/Course/RB_Class_ViewModel.cs
View file @
d204940b
...
...
@@ -206,6 +206,11 @@ namespace Edu.Model.ViewModel.Course
}
}
/// <summary>
/// 查询有未报满的班级
/// </summary>
public
int
IsQuerySurplus
{
get
;
set
;
}
}
/// <summary>
...
...
Edu.Repository/Course/RB_ClassRepository.cs
View file @
d204940b
...
...
@@ -24,8 +24,9 @@ namespace Edu.Repository.Course
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM rb_class AS A
SELECT A.* ,IFNULL(B.CourseName,'') AS CourseName,IFNULL(C.GuestNum,0) AS GuestNum
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN(SELECT ClassId,SUM(GuestNum) AS GuestNum FROM rb_order WHERE OrderState=1 GROUP BY ClassId) AS C ON A.ClassId=C.ClassId
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
...
...
@@ -47,6 +48,11 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0} in({1}) "
,
nameof
(
RB_Class_ViewModel
.
ClassId
),
query
.
Q_ClassIds
);
}
//查询未报满的班级
if
(
query
.
IsQuerySurplus
==
1
)
{
builder
.
AppendFormat
(
" AND A.{0}>IFNULL(C.GuestNum,0) "
,
nameof
(
RB_Class_ViewModel
.
ClassPersion
));
}
}
return
Get
<
RB_Class_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
...
...
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
d204940b
...
...
@@ -122,6 +122,7 @@ namespace Edu.WebApi.Controllers.Course
var
query
=
new
RB_Class_ViewModel
()
{
CouseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
),
IsQuerySurplus
=
base
.
ParmJObj
.
GetInt
(
"IsQuerySurplus"
),
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
...
...
@@ -143,6 +144,7 @@ namespace Edu.WebApi.Controllers.Course
qitem
.
ClassId
,
qitem
.
ClassName
,
qitem
.
ClassHours
,
qitem
.
CourseName
,
OpenTime
=
Common
.
ConvertHelper
.
FormatDate
(
qitem
.
OpenTime
)
}));
}
...
...
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