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
63ee2e9c
Commit
63ee2e9c
authored
Apr 17, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug && add oss_config
parent
0dbab1e8
Pipeline
#21843
passed with stage
in 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
11 deletions
+16
-11
institution.js
app/service/course/v5/institution.js
+6
-11
config.prod.js
config/config.prod.js
+10
-0
No files found.
app/service/course/v5/institution.js
View file @
63ee2e9c
...
...
@@ -166,21 +166,16 @@ class InstitutionSubService extends Service {
const
page_size
=
Number
(
input
.
page_size
)
||
10
;
const
offset
=
(
page
-
1
)
*
page_size
;
const
attributes
=
[
'id'
,
'institution_id'
,
'name'
,
'logo'
,
'age'
,
'price'
,
'price_type'
,
'mode'
,
'time'
,
'class_amount'
,
'multi_classes'
,
'cycle'
,
'description'
,
'sort'
];
const
filter
=
{
where
:
{
status
:
1
,
is_deleted
:
0
},
order
:
[[
'sort'
,
'asc'
],
[
'id'
,
'desc'
]],
page_size
,
offset
,
attributes
};
const
classList
=
await
ctx
.
classModel
.
V5
.
CourseV5Class
.
findAndCountAll
(
filter
);
// 用户收藏的课程
const
userCollection
=
await
ctx
.
classModel
.
V5
.
CourseUserCollection
.
findAll
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
is_deleted
:
0
,
type
:
3
},
raw
:
true
});
const
collectedIds
=
R
.
pluck
(
'type_id'
,
userCollection
);
for
(
const
i
in
classList
.
rows
)
{
classList
.
rows
[
i
].
is_collected
=
collectedIds
.
includes
(
classList
.
rows
[
i
].
id
)
?
1
:
0
;
}
const
userCollection
=
await
ctx
.
classModel
.
V5
.
CourseUserCollection
.
findAndCountAll
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
is_deleted
:
0
,
type
:
3
},
raw
:
true
});
const
collectedIds
=
R
.
pluck
(
'type_id'
,
userCollection
.
rows
);
const
filter
=
{
where
:
{
id
:
{
$in
:
collectedIds
},
status
:
1
,
is_deleted
:
0
},
page_size
,
offset
,
attributes
,
raw
:
true
};
const
classList
=
await
ctx
.
classModel
.
V5
.
CourseV5Class
.
findAll
(
filter
);
const
ret
=
{
list
:
classList
.
rows
,
total_count
:
classList
.
count
,
list
:
classList
,
total_count
:
userCollection
.
count
,
page
,
page_size
,
};
...
...
config/config.prod.js
View file @
63ee2e9c
...
...
@@ -124,6 +124,16 @@ module.exports = appInfo => {
},
};
exports
.
oss
=
{
// sdfsdfsd
client
:
{
accessKeyId
:
'LTAIxEMB8ucstyi8'
,
accessKeySecret
:
'sCVJSCPyfaSIlS5R8fH4Xl77yHKR3z'
,
bucket
:
'51shequ'
,
endpoint
:
'oss-cn-hangzhou.aliyuncs.com'
,
timeout
:
'60s'
,
},
};
config
.
CDN_BASE_URL
=
'https://r.51gjj.com/image/'
;
config
.
NODE_URL
=
process
.
env
.
NODE_URL
;
config
.
NODE_BASE_URL
=
process
.
env
.
NODE_BASE_URL
;
...
...
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