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
7bc30565
Commit
7bc30565
authored
Sep 27, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
79de2669
Pipeline
#14390
passed with stage
in 12 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
12 deletions
+36
-12
institution.js
app/service/course/institution.js
+35
-11
option.js
app/service/course/option.js
+1
-1
No files found.
app/service/course/institution.js
View file @
7bc30565
...
...
@@ -64,7 +64,7 @@ class InstitutionService extends Service {
const
{
ctx
}
=
this
;
const
user_uuid
=
ctx
.
userUuid
;
const
{
institution_id
,
area_id
}
=
input
;
const
{
institution_id
,
area_id
}
=
input
;
const
lat
=
ctx
.
isEmpty
(
input
.
lat
)
?
0
:
input
.
lat
;
const
lng
=
ctx
.
isEmpty
(
input
.
lng
)
?
0
:
input
.
lng
;
const
institution
=
await
ctx
.
classModel
.
CourseInstitution
.
one
({
where
:
{
id
:
institution_id
}
});
...
...
@@ -93,7 +93,7 @@ class InstitutionService extends Service {
for
(
let
i
in
area_rows
)
{
const
area
=
area_rows
[
i
];
const
lbs
=
i
<
area_lbs
.
length
?
area_lbs
[
i
]
:
{
distance
:
0
,
duration
:
0
,
travel_method
:
''
};
const
lbs
=
i
<
area_lbs
.
length
?
area_lbs
[
i
]
:
{
distance
:
0
,
duration
:
0
,
travel_method
:
''
};
const
area_name
=
area
.
name
;
const
distance
=
lbs
.
distance
;
const
duration
=
lbs
.
duration
;
...
...
@@ -152,7 +152,7 @@ class InstitutionService extends Service {
teacher
.
dataValues
.
point_tags
=
teacher
.
point
?
teacher
.
point
.
split
(
';'
)
:
[];
teacher
.
dataValues
.
work_experience_tags
=
teacher
.
work_experience
?
teacher
.
work_experience
.
split
(
';'
)
:
[];
const
institution
=
await
ctx
.
classModel
.
CourseInstitution
.
find
({
where
:
{
id
:
teacher
.
institution_id
}
});
const
institution
=
await
ctx
.
classModel
.
CourseInstitution
.
find
({
where
:
{
id
:
teacher
.
institution_id
}
});
teacher
.
dataValues
.
institution_name
=
institution
.
name
;
return
teacher
;
...
...
@@ -178,7 +178,22 @@ class InstitutionService extends Service {
const
where
=
{
institution_id
};
const
teachers
=
await
ctx
.
classModel
.
CourseTeacher
.
list
({
attributes
,
page
,
limit
,
where
});
return
teachers
;
const
ret
=
[];
for
(
let
i
in
teachers
)
{
const
teacher
=
teachers
[
i
];
ret
.
push
({
id
:
teacher
.
id
,
institution_id
:
teacher
.
institution_id
,
name
:
teacher
.
name
?
teacher
.
name
:
''
,
avatar
:
teacher
.
avatar
?
teacher
.
avatar
:
''
,
teacher_experience
:
teacher
.
teacher_experience
?
teacher
.
teacher_experience
:
''
,
lesson
:
teacher
.
lesson
?
teacher
.
lesson
:
''
,
educational_background
:
teacher
.
educational_background
?
teacher
.
educational_background
:
''
,
certificate
:
teacher
.
certificate
?
teacher
.
certificate
:
''
,
});
}
return
ret
;
}
...
...
@@ -344,7 +359,7 @@ class InstitutionService extends Service {
let
institution_area
=
institution_areas
[
i
];
//TODO 校验经纬度
const
lbs
=
i
<
institution_lbs
.
length
?
institution_lbs
[
i
]
:
{
distance
:
0
,
duration
:
0
,
travel_method
:
''
};
const
lbs
=
i
<
institution_lbs
.
length
?
institution_lbs
[
i
]
:
{
distance
:
0
,
duration
:
0
,
travel_method
:
''
};
const
area_name
=
institution_area
.
area_name
;
const
distance
=
lbs
.
distance
;
...
...
@@ -405,7 +420,16 @@ class InstitutionService extends Service {
// if (!course_areas || course_areas.length === 0) continue;
const
age_tag
=
institution
.
min_age
+
'-'
+
institution
.
max_age
+
'岁'
;
const
build_time
=
moment
().
format
(
'YYYY'
)
-
institution
.
establishment_time
;
const
tags
=
[
age_tag
,
institution
.
class_type
,
'成立'
+
build_time
+
'年'
];
const
tags
=
[];
if
(
institution
.
max_age
)
{
tags
.
push
(
age_tag
);
}
if
(
institution
.
class_type
)
{
tags
.
push
(
institution
.
class_type
);
}
if
(
build_time
)
{
tags
.
push
(
'成立'
+
build_time
+
'年'
);
}
const
image
=
institution_images
[
i
]
?
institution_images
[
i
].
image_url
:
''
;
ret
.
push
({
...
...
@@ -414,16 +438,16 @@ class InstitutionService extends Service {
image
,
establishment_time
:
institution
.
establishment_time
,
class_type
:
institution
.
class_type
,
teacher_count
:
institution
.
teacher_count
,
teacher_experience
:
institution
.
teacher_experience
,
corner
:
institution
.
corner
,
teacher_count
:
institution
.
teacher_count
?
institution
.
teacher_count
:
0
,
teacher_experience
:
institution
.
teacher_experience
?
institution
.
teacher_experience
:
0
,
corner
:
institution
.
corner
?
institution
.
corner
:
''
,
min_age
:
institution
.
min_age
,
max_age
:
institution
.
max_age
,
price
:
institution
.
price
,
price
:
institution
.
price
?
institution
.
price
:
0
,
tags
,
area_id
:
institution
.
area_id
,
//校区id TODO
travel_tips
:
institution
.
travel_tips
,
//TODO
characteristic
:
institution
.
characteristic
,
characteristic
:
institution
.
characteristic
?
institution
.
characteristic
:
''
,
});
}
...
...
app/service/course/option.js
View file @
7bc30565
...
...
@@ -58,7 +58,7 @@ class OptionService extends Service {
newNode
.
level
=
node
.
level
;
newNode
.
value
=
node
.
id
;
newNode
.
_child
=
this
.
getTrees
(
data
,
node
.
id
);
if
(
newNode
.
_child
.
length
!==
0
)
newNode
.
_child
.
unshift
({
id
:
0
,
name
:
'全部'
,
value
:
''
});
if
(
newNode
.
_child
.
length
!==
0
)
newNode
.
_child
.
unshift
({
id
:
0
,
name
:
'全部'
,
value
:
0
});
ret
.
push
(
newNode
);
}
}
...
...
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