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
92903787
Commit
92903787
authored
Nov 20, 2019
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
0b686c64
Pipeline
#16804
passed with stage
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
institution.js
app/service/course/v2/institution.js
+5
-6
No files found.
app/service/course/v2/institution.js
View file @
92903787
...
...
@@ -87,11 +87,10 @@ class InstitutionSubService extends Service {
const
student_video
=
await
ctx
.
classModel
.
V2
.
CourseStudentVideo
.
findAll
({
where
:
{
institution_id
,
status
:
'online'
,
is_deleted
:
0
},
order
:
[[
'sort'
,
'asc'
]]
});
// 教师
const
teachers
=
await
ctx
.
classModel
.
V2
.
CourseTeacher
.
findAll
({
where
:
{
institution_id
,
status
:
'online'
,
is_deleted
:
0
}
});
const
teachers
=
await
ctx
.
classModel
.
V2
.
CourseTeacher
.
findAll
({
where
:
{
institution_id
,
status
:
'online'
,
is_deleted
:
0
}
,
raw
:
true
});
// 课程
let
classes
=
await
ctx
.
classModel
.
V2
.
CourseClass
.
findAll
({
where
:
{
institution_id
,
status
:
'online'
,
is_deleted
:
0
},
row
:
true
});
classes
=
R
.
pluck
(
'dataValues'
,
classes
);
const
classes
=
await
ctx
.
classModel
.
V2
.
CourseClass
.
findAll
({
where
:
{
institution_id
,
status
:
'online'
,
is_deleted
:
0
},
raw
:
true
});
// 处理课程封面图
const
classHandle
=
[];
if
(
classes
.
length
>
0
)
{
...
...
@@ -110,7 +109,7 @@ class InstitutionSubService extends Service {
}
// 校区
let
areas
=
await
ctx
.
classModel
.
V2
.
CourseArea
.
findAll
({
where
:
{
institution_id
,
status
:
'online'
,
is_deleted
:
0
}
});
let
areas
=
await
ctx
.
classModel
.
V2
.
CourseArea
.
findAll
({
where
:
{
institution_id
,
status
:
'online'
,
is_deleted
:
0
}
,
raw
:
true
});
const
areaHandle
=
[];
if
(
areas
.
length
>
0
)
{
for
(
const
v
of
areas
)
{
...
...
@@ -439,7 +438,7 @@ class InstitutionSubService extends Service {
async
getUserSearch
()
{
const
{
ctx
}
=
this
;
const
userUuid
=
ctx
.
userUuid
;
const
search
=
await
ctx
.
classModel
.
V2
.
CourseUserSearch
.
findAll
({
where
:
{
status
:
'online'
,
user_uuid
:
userUuid
},
limit
:
10
,
order
:
[[
'id'
],
[
'desc'
]]
});
const
search
=
await
ctx
.
classModel
.
V2
.
CourseUserSearch
.
findAll
({
where
:
{
status
:
'online'
,
user_uuid
:
userUuid
},
limit
:
10
,
order
:
[[
'id'
,
'desc'
]]
});
const
result
=
_
.
uniq
(
R
.
pluck
(
'content'
,
search
));
const
ret
=
{
...
...
@@ -631,7 +630,7 @@ class InstitutionSubService extends Service {
// 课程图片
let
images
=
await
ctx
.
classModel
.
V2
.
CourseImages
.
findAll
({
where
:
{
type
:
2
,
type_id
:
id
,
status
:
'online'
,
is_deleted
:
0
},
raw
:
true
});
// 去重
images
=
_
.
uniqBy
(
images
,
function
(
v
)
{
return
(
v
.
is_image
===
1
?
v
.
image_url
:
v
.
video_url
)
;
});
images
=
_
.
uniqBy
(
images
,
function
(
v
)
{
return
(
v
.
is_image
===
1
?
v
.
image_url
:
v
.
video_url
)
;
});
images
=
_
.
orderBy
(
images
,
[
'sort'
],
[
'asc'
]);
classInfo
.
images
=
images
;
...
...
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