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
65cc279b
Commit
65cc279b
authored
Feb 01, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台获取订单详情
parent
dbed0067
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
198 additions
and
47 deletions
+198
-47
CourseClassTypeEnum.cs
Mall.Common/Enum/Point/CourseClassTypeEnum.cs
+1
-1
OrderStausEnum.cs
Mall.Common/Enum/Point/OrderStausEnum.cs
+1
-1
RB_Point_TeacherCourseOrder.cs
Mall.Model/Entity/Point/RB_Point_TeacherCourseOrder.cs
+1
-8
RB_Point_TeacherCourseOrder_Extend.cs
....Model/Extend/Point/RB_Point_TeacherCourseOrder_Extend.cs
+24
-1
PointModule.cs
Mall.Module.Education/PointModule.cs
+11
-0
RB_Point_TeacherCourseOrderRepository.cs
...Repository/Point/RB_Point_TeacherCourseOrderRepository.cs
+71
-2
PointController.cs
Mall.WebApi/Controllers/Education/PointController.cs
+89
-34
No files found.
Mall.Common/Enum/Point/CourseClassTypeEnum.cs
View file @
65cc279b
...
...
@@ -26,7 +26,7 @@ namespace Mall.Common.Enum.Point
/// 公开课
/// </summary>
[
EnumField
(
"公开课"
)]
Public
=
2
4
,
Public
=
4
,
/// <summary>
/// 兴趣主题课
/// </summary>
...
...
Mall.Common/Enum/Point/OrderStausEnum.cs
View file @
65cc279b
...
...
@@ -29,6 +29,6 @@ namespace Mall.Common.Enum.Point
/// 完成
/// </summary>
[
EnumField
(
"完成"
)]
Complete
=
4
Complete
=
3
}
}
Mall.Model/Entity/Point/RB_Point_TeacherCourseOrder.cs
View file @
65cc279b
...
...
@@ -21,17 +21,10 @@ namespace Mall.Model.Entity.Point
/// </summary>
public
int
CourseClassId
{
get
;
set
;
}
/// <summary>
/// 课程名称
/// </summary>
public
string
CourseName
{
get
;
set
;
}
/// <summary>
/// 课程Id
/// </summary>
public
string
CourseId
{
get
;
set
;
}
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 老师id
...
...
Mall.Model/Extend/Point/RB_Point_TeacherCourseOrder_Extend.cs
View file @
65cc279b
...
...
@@ -5,8 +5,31 @@ using Mall.Model.Entity.Point;
namespace
Mall.Model.Extend.Point
{
public
class
RB_Point_TeacherCourseOrder_Extend
:
RB_Point_TeacherCourseOrder
public
class
RB_Point_TeacherCourseOrder_Extend
:
RB_Point_TeacherCourseOrder
{
/// <summary>
/// 课程名称
/// </summary>
public
string
CourseName
{
get
;
set
;
}
/// <summary>
/// 课程分类名称
/// </summary>
public
Common
.
Enum
.
Point
.
CourseClassTypeEnum
CourseClassType
{
get
;
set
;
}
/// <summary>
/// 教师名称
/// </summary>
public
string
TeacherName
{
get
;
set
;
}
/// <summary>
/// 教师头像
/// </summary>
public
string
TeacherLogo
{
get
;
set
;
}
/// <summary>
/// 用户名称
/// </summary>
public
string
UserName
{
get
;
set
;
}
}
}
Mall.Module.Education/PointModule.cs
View file @
65cc279b
...
...
@@ -586,6 +586,17 @@ namespace Mall.Module.Education
return
pointTeacherCourseOrderRepository
.
GetPointOrderPageList
(
pageIndex
,
pageSize
,
out
rowsCount
,
where
);
}
/// <summary>
/// 获取订单详情
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public
RB_Point_TeacherCourseOrder_Extend
GetPointOrderInfo
(
int
orderId
,
int
MallBaseId
)
{
var
model
=
pointTeacherCourseOrderRepository
.
GetPointOrderInfo
(
new
RB_Point_TeacherCourseOrder_Extend
()
{
ID
=
orderId
,
MallBaseId
=
MallBaseId
});
return
model
;
}
public
bool
SetTeacherCourseOrder
(
RB_Point_TeacherCourseOrder_Extend
model
)
...
...
Mall.Repository/Point/RB_Point_TeacherCourseOrderRepository.cs
View file @
65cc279b
...
...
@@ -55,7 +55,13 @@ namespace Mall.Repository.Point
public
List
<
RB_Point_TeacherCourseOrder_Extend
>
GetPointOrderPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Point_TeacherCourseOrder_Extend
where
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$@"SELECT a.*,b.`Name` as UserName from RB_Point_TeacherCourseOrder as a LEFT JOIN rb_member_user as b on a.UserId=b.Id where a.state=0 "
);
sb
.
Append
(
$@"SELECT a.*,b.`Name` as UserName , t.CourseName,c.CourseClassType, d.Name as TeacherName ,d.TeacherLogo
from RB_Point_TeacherCourseOrder as a
Left join rb_point_teachercourse t on a.CourseId = t.ID
Left Join rb_point_courseclass c on a.CourseClassId = c.ID
Left JOin rb_education_teacher d on a.TeacherId = d.ID
LEFT JOIN rb_member_user as b on a.UserId=b.Id
where a.state=0 "
);
if
(
where
!=
null
)
{
if
(
where
.
TenantId
>
0
)
...
...
@@ -70,12 +76,75 @@ namespace Mall.Repository.Point
{
sb
.
AppendFormat
(
" and a.ID={0}"
,
where
.
ID
);
}
if
(
where
.
OrderStaus
>
0
)
if
(
where
.
OrderStaus
>
=
0
)
{
sb
.
AppendFormat
(
" and a.OrderStaus={0}"
,
where
.
OrderStaus
);
}
if
(
where
.
TeacherId
>
0
)
{
sb
.
AppendFormat
(
" and a.TeacherId={0}"
,
where
.
TeacherId
);
}
if
(
where
.
CourseId
>
0
)
{
sb
.
AppendFormat
(
" and a.CourseId={0}"
,
where
.
CourseId
);
}
if
(
where
.
UserId
>
0
)
{
sb
.
AppendFormat
(
" and a.UserId={0}"
,
where
.
UserId
);
}
}
sb
.
AppendFormat
(
" order by a.ID desc"
);
return
GetPage
<
RB_Point_TeacherCourseOrder_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
sb
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取明细
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public
RB_Point_TeacherCourseOrder_Extend
GetPointOrderInfo
(
RB_Point_TeacherCourseOrder_Extend
where
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$@"SELECT a.*,b.`Name` as UserName , t.CourseName,c.CourseClassType, d.Name as TeacherName ,d.TeacherLogo
from RB_Point_TeacherCourseOrder as a
Left join rb_point_teachercourse t on a.CourseId = t.ID
Left Join rb_point_courseclass c on a.CourseClassId = c.ID
Left JOin rb_education_teacher d on a.TeacherId = d.ID
LEFT JOIN rb_member_user as b on a.UserId=b.Id
where a.state=0 "
);
if
(
where
!=
null
)
{
if
(
where
.
TenantId
>
0
)
{
sb
.
AppendFormat
(
" and a.TenantId={0}"
,
where
.
TenantId
);
}
if
(
where
.
MallBaseId
>
0
)
{
sb
.
AppendFormat
(
" and a.MallBaseId={0}"
,
where
.
MallBaseId
);
}
if
(
where
.
ID
>
0
)
{
sb
.
AppendFormat
(
" and a.ID={0}"
,
where
.
ID
);
}
if
(
where
.
OrderStaus
>=
0
)
{
sb
.
AppendFormat
(
" and a.OrderStaus={0}"
,
where
.
OrderStaus
);
}
if
(
where
.
TeacherId
>
0
)
{
sb
.
AppendFormat
(
" and a.TeacherId={0}"
,
where
.
TeacherId
);
}
if
(
where
.
CourseId
>
0
)
{
sb
.
AppendFormat
(
" and a.CourseId={0}"
,
where
.
CourseId
);
}
if
(
where
.
UserId
>
0
)
{
sb
.
AppendFormat
(
" and a.UserId={0}"
,
where
.
UserId
);
}
}
sb
.
AppendFormat
(
" order by a.ID desc"
);
return
Get
<
RB_Point_TeacherCourseOrder_Extend
>(
sb
.
ToString
()).
FirstOrDefault
();
}
}
}
Mall.WebApi/Controllers/Education/PointController.cs
View file @
65cc279b
...
...
@@ -152,40 +152,7 @@ namespace Mall.WebApi.Controllers.Education
#
endregion
#
region
个人中心
-
点数记录
/// <summary>
/// 小程序获取点数记录
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletUserPointDetailPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
RB_Member_PointBalance_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Member_PointBalance_Extend
>(
RequestParm
.
msg
.
ToString
());
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
var
list
=
pointModule
.
GetUserPointDetailPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
int
PointNum
=
pointModule
.
GetUserPointBalance
(
userInfo
.
UserId
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
new
{
PointNum
,
List
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Type
,
TypeName
=
x
.
Type
.
GetEnumName
(),
x
.
Description
,
x
.
PonitNum
,
x
.
Remarks
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
})
};
return
ApiResult
.
Success
(
""
,
pagelist
);
}
#
region
点数记录
/// <summary>
/// 后台获取点数记录
...
...
@@ -225,6 +192,94 @@ namespace Mall.WebApi.Controllers.Education
}
#
endregion
#
region
订单列表
/// <summary>
/// 获取订单列表分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetPointOrderPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
UserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
RB_Point_TeacherCourseOrder_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Point_TeacherCourseOrder_Extend
>(
RequestParm
.
msg
.
ToString
());
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
var
list
=
pointModule
.
GetPointOrderPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
ID
,
x
.
CourseClassId
,
CourseClassTypeName
=
x
.
CourseClassType
.
GetEnumName
(),
x
.
CourseId
,
x
.
CourseName
,
x
.
TeacherId
,
x
.
TeacherName
,
x
.
TeacherLogo
,
StudyDate
=
x
.
StudyDate
.
ToString
(
"MM-dd HH:mm"
),
x
.
StudyDuration
,
x
.
TotalStudyDuration
,
DurationUnit
=
x
.
DurationUnit
.
GetEnumName
(),
x
.
OrderStaus
,
OrderStatusName
=
x
.
OrderStaus
.
GetEnumName
(),
x
.
IsSendRoom
,
x
.
RoomInfo
,
x
.
TotalPointNum
,
x
.
ActualPointNum
,
x
.
BasePointNum
,
x
.
UserId
,
x
.
UserName
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取订单详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetPointOrderInfo
()
{
var
userInfo
=
UserInfo
;
var
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
if
(
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
}
var
model
=
pointModule
.
GetPointOrderInfo
(
OrderId
,
userInfo
.
MallBaseId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"订单不存在"
);}
return
ApiResult
.
Success
(
""
,
new
{
model
.
ID
,
model
.
CourseClassId
,
CourseClassTypeName
=
model
.
CourseClassType
.
GetEnumName
(),
model
.
CourseId
,
model
.
CourseName
,
model
.
TeacherId
,
model
.
TeacherName
,
model
.
TeacherLogo
,
StudyDate
=
model
.
StudyDate
.
ToString
(
"MM-dd HH:mm"
),
model
.
StudyDuration
,
model
.
TotalStudyDuration
,
DurationUnit
=
model
.
DurationUnit
.
GetEnumName
(),
model
.
OrderStaus
,
OrderStatusName
=
model
.
OrderStaus
.
GetEnumName
(),
model
.
IsSendRoom
,
model
.
RoomInfo
,
model
.
TotalPointNum
,
model
.
ActualPointNum
,
model
.
BasePointNum
,
model
.
UserId
,
model
.
UserName
,
CreateDate
=
model
.
CreateDate
.
HasValue
?
model
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
});
}
#
endregion
#
region
在线课程分类
/// <summary>
/// 课程分类
...
...
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