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
33d00258
Commit
33d00258
authored
Nov 21, 2019
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add cover_image
parent
92903787
Pipeline
#16873
passed with stage
in 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
16 deletions
+2
-16
courseStudentVideo.js
app/model/class/v2/courseStudentVideo.js
+1
-0
institution.js
app/service/course/v2/institution.js
+1
-16
No files found.
app/model/class/v2/courseStudentVideo.js
View file @
33d00258
...
@@ -18,6 +18,7 @@ module.exports = app => {
...
@@ -18,6 +18,7 @@ module.exports = app => {
age
:
STRING
,
age
:
STRING
,
time
:
STRING
,
time
:
STRING
,
sort
:
INTEGER
,
sort
:
INTEGER
,
cover_image
:
STRING
,
status
:
ENUM
(
'offline'
,
'online'
),
status
:
ENUM
(
'offline'
,
'online'
),
is_deleted
:
INTEGER
,
is_deleted
:
INTEGER
,
created_time
:
{
created_time
:
{
...
...
app/service/course/v2/institution.js
View file @
33d00258
...
@@ -169,6 +169,7 @@ class InstitutionSubService extends Service {
...
@@ -169,6 +169,7 @@ class InstitutionSubService extends Service {
// 暂定3公里以内步行
// 暂定3公里以内步行
area
.
travel_method
=
distance
<
3000
?
'walking'
:
'driving'
;
area
.
travel_method
=
distance
<
3000
?
'walking'
:
'driving'
;
const
lbsResult
=
await
service
.
course
.
v2
.
lbs
.
getLBSDistance
(
area
.
travel_method
,
{
lng
:
location
.
lng
,
lat
:
location
.
lat
},
[{
lng
:
area
.
lng
,
lat
:
area
.
lat
}]);
const
lbsResult
=
await
service
.
course
.
v2
.
lbs
.
getLBSDistance
(
area
.
travel_method
,
{
lng
:
location
.
lng
,
lat
:
location
.
lat
},
[{
lng
:
area
.
lng
,
lat
:
area
.
lat
}]);
console
.
log
(
lbsResult
);
if
(
lbsResult
.
results
.
length
>
0
)
{
if
(
lbsResult
.
results
.
length
>
0
)
{
area
.
distance
=
(
lbsResult
.
results
[
0
].
distance
/
1000
).
toFixed
(
1
);
area
.
distance
=
(
lbsResult
.
results
[
0
].
distance
/
1000
).
toFixed
(
1
);
area
.
duration
=
lbsResult
.
results
[
0
].
duration
;
area
.
duration
=
lbsResult
.
results
[
0
].
duration
;
...
@@ -571,22 +572,6 @@ class InstitutionSubService extends Service {
...
@@ -571,22 +572,6 @@ class InstitutionSubService extends Service {
}
}
// 教师详情
async
getTeacher
(
id
)
{
const
{
ctx
}
=
this
;
const
teacher
=
await
ctx
.
classModel
.
V2
.
CourseTeacher
.
findOne
({
where
:
{
id
,
status
:
'online'
,
is_deleted
:
0
},
raw
:
true
});
if
(
ctx
.
isEmpty
(
teacher
))
{
ctx
.
failed
(
'数据不存在'
);
}
teacher
.
point_tags
=
teacher
.
point
?
teacher
.
point
.
split
(
','
)
:
[];
teacher
.
work_experience_tags
=
teacher
.
work_experience
?
teacher
.
work_experience
.
split
(
';'
)
:
[];
const
institution
=
await
ctx
.
classModel
.
V2
.
CourseInstitution
.
findOne
({
where
:
{
id
:
teacher
.
institution_id
}
});
teacher
.
institution_name
=
institution
.
name
;
return
teacher
;
}
// 课程列表
// 课程列表
async
getClasses
(
input
)
{
async
getClasses
(
input
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
...
...
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