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
4895595e
Commit
4895595e
authored
Sep 30, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课程章节调整
parent
2a033fd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+21
-0
AppletSchoolController.cs
Mall.WebApi/Controllers/Education/AppletSchoolController.cs
+29
-2
No files found.
Mall.Module.Product/ProductModule.cs
View file @
4895595e
...
...
@@ -3401,6 +3401,27 @@ namespace Mall.Module.Product
//查询观看数量
return
list
;
}
/// <summary>
/// 获取课程是否购买
/// </summary>
/// <param name="goodsId"></param>
/// <param name="UserId"></param>
/// <returns></returns>
public
bool
GetAppletCourseIsPay
(
int
goodsId
,
int
UserId
)
{
if
(
UserId
<=
0
)
{
return
false
;
}
var
omodel
=
goods_OrderRepository
.
GetCourseOrderIsPay
(
GoodsIds
:
goodsId
.
ToString
(),
UserId
:
UserId
).
FirstOrDefault
();
if
(
omodel
!=
null
)
{
if
(
omodel
.
PaymentTime
.
HasValue
)
{
return
true
;
}
}
return
false
;
}
#
endregion
#
region
素材管理
...
...
Mall.WebApi/Controllers/Education/AppletSchoolController.cs
View file @
4895595e
...
...
@@ -175,6 +175,7 @@ namespace Mall.WebApi.Controllers.Education
}
var
list
=
productModule
.
GetAppletGoodsCourseList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
GoodsId
,
req
.
TenantId
,
req
.
MallBaseId
);
bool
IsPay
=
productModule
.
GetAppletCourseIsPay
(
GoodsId
,
req
.
UserId
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
...
...
@@ -187,15 +188,41 @@ namespace Mall.WebApi.Controllers.Education
x
.
IsTrySee
,
x
.
Number
,
x
.
IsCache
,
x
.
FilePath
,
FilePath
=
x
.
IsTrySee
==
1
||
IsPay
?
x
.
FilePath
:
""
,
x
.
IsImageOK
,
x
.
VideoImage
,
x
.
VideoTime
,
ImageList
=
!
string
.
IsNullOrEmpty
(
x
.
Image
)
&&
x
.
Image
!=
"[]"
?
JsonConvert
.
DeserializeObject
<
List
<
CourseImageModel
>>(
x
.
Image
)
:
new
List
<
CourseImageModel
>()
IsPay
,
ImageList
=
GetCourseImage
(
x
.
IsTrySee
??
0
,
IsPay
,
x
.
Number
??
0
,
x
.
Image
)
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取课程图片
/// </summary>
/// <param name="IsTrySee"></param>
/// <param name="IsPay"></param>
/// <param name="Number"></param>
/// <param name="Image"></param>
/// <returns></returns>
public
List
<
CourseImageModel
>
GetCourseImage
(
int
IsTrySee
,
bool
IsPay
,
int
Number
,
string
Image
)
{
if
(
string
.
IsNullOrEmpty
(
Image
)
||
Image
==
"[]"
)
{
return
new
List
<
CourseImageModel
>();
}
if
(
IsPay
)
{
return
JsonConvert
.
DeserializeObject
<
List
<
CourseImageModel
>>(
Image
);
}
if
(
IsTrySee
==
1
)
{
var
list
=
JsonConvert
.
DeserializeObject
<
List
<
CourseImageModel
>>(
Image
);
if
(
Number
>
0
)
{
list
=
list
.
Take
(
Number
).
ToList
();
}
return
list
;
}
return
new
List
<
CourseImageModel
>();
}
#
endregion
#
region
资讯
...
...
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