Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
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
方斌
51business
Commits
2c4bb343
Commit
2c4bb343
authored
Jun 09, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pay_count,sub_title,video_count
parent
78116fd6
Pipeline
#24741
passed with stage
in 4 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
courseV5Class.js
app/model/class/v5/courseV5Class.js
+2
-0
institution.js
app/service/course/v5/institution.js
+9
-1
No files found.
app/model/class/v5/courseV5Class.js
View file @
2c4bb343
...
...
@@ -33,6 +33,8 @@ module.exports = app => {
button_pay_text
:
STRING
,
top_price
:
STRING
,
pay_price
:
DECIMAL
,
sub_title
:
STRING
,
pay_count
:
INTEGER
,
sort
:
INTEGER
,
status
:
INTEGER
,
is_deleted
:
INTEGER
,
...
...
app/service/course/v5/institution.js
View file @
2c4bb343
...
...
@@ -99,7 +99,7 @@ class InstitutionSubService extends Service {
// 课程详情
async
getClassInfo
(
id
)
{
const
{
ctx
}
=
this
;
const
attributes
=
[
'id'
,
'institution_id'
,
'name'
,
'logo'
,
'age'
,
'price'
,
'price_type'
,
'mode'
,
'time'
,
'class_amount'
,
'multi_classes'
,
'cycle'
,
'description'
,
'button_style'
,
'button_text'
,
'button_type'
,
'button_sub_text'
,
'button_url'
,
'button_pay_text'
,
'top_price'
,
'pay_price'
,
'sort'
];
const
attributes
=
[
'id'
,
'institution_id'
,
'name'
,
'logo'
,
'age'
,
'price'
,
'price_type'
,
'mode'
,
'time'
,
'class_amount'
,
'multi_classes'
,
'cycle'
,
'description'
,
'button_style'
,
'button_text'
,
'button_type'
,
'button_sub_text'
,
'button_url'
,
'button_pay_text'
,
'top_price'
,
'pay_price'
,
's
ub_title'
,
'pay_count'
,
's
ort'
];
const
classInfo
=
await
ctx
.
classModel
.
V5
.
CourseV5Class
.
findOne
({
where
:
{
id
,
status
:
1
,
is_deleted
:
0
},
attributes
,
raw
:
true
});
if
(
ctx
.
isEmpty
(
classInfo
))
{
ctx
.
failed
(
'数据不存在'
);
...
...
@@ -163,6 +163,12 @@ class InstitutionSubService extends Service {
const
userOrder
=
ctx
.
isEmpty
(
ctx
.
userUuid
)
?
{}
:
await
ctx
.
classModel
.
V5
.
CourseUserOrder
.
findOne
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
class_id
:
id
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
]
});
classInfo
.
is_bought
=
ctx
.
isEmpty
(
userOrder
)
?
0
:
1
;
// 视频总数
const
videoCount
=
await
ctx
.
classModel
.
V5
.
CourseV5Video
.
count
({
where
:
{
class_id
:
id
,
status
:
1
,
is_deleted
:
0
}
});
// 订单总数
const
orderCount
=
await
ctx
.
classModel
.
V5
.
CourseUserOrder
.
count
({
where
:
{
class_id
:
id
,
status
:
1
,
is_deleted
:
0
}
});
classInfo
.
price_type
=
await
this
.
getClassPriceType
(
classInfo
.
price_type
);
classInfo
.
mode
=
await
this
.
getClassMode
(
classInfo
.
mode
);
classInfo
.
student_works
=
studentWorks
;
...
...
@@ -172,6 +178,8 @@ class InstitutionSubService extends Service {
classInfo
.
institution_name
=
ctx
.
isEmpty
(
institution
)
?
''
:
institution
.
name
;
classInfo
.
institution_logo
=
ctx
.
isEmpty
(
institution
)
?
''
:
institution
.
logo
;
classInfo
.
institution_description
=
ctx
.
isEmpty
(
institution
)
?
''
:
institution
.
description
;
classInfo
.
pay_count
+=
orderCount
;
classInfo
.
video_count
=
videoCount
;
return
classInfo
;
}
...
...
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