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
3e06ea3b
Commit
3e06ea3b
authored
Sep 25, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
010adeab
Pipeline
#14206
passed with stage
in 20 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
institution.js
app/service/course/institution.js
+2
-4
user.js
app/service/course/user.js
+2
-2
No files found.
app/service/course/institution.js
View file @
3e06ea3b
...
@@ -275,10 +275,8 @@ class InstitutionService extends Service {
...
@@ -275,10 +275,8 @@ class InstitutionService extends Service {
}
}
const
from
=
from_gps
;
const
from
=
from_gps
;
console
.
info
(
'11111111111111111111111111'
);
const
lat
=
from
.
lat
;
console
.
info
(
from_gps
);
const
lng
=
from
.
lng
;
const
lat
=
from_gps
.
lat
;
const
lng
=
from_gps
.
lng
;
// console.info({ lat, lng });
// console.info({ lat, lng });
//计算距离
//计算距离
const
driving_results
=
await
ctx
.
service
.
course
.
lbs
.
getLBSDistance
(
'driving'
,
{
lat
,
lng
},
lbs_array
);
const
driving_results
=
await
ctx
.
service
.
course
.
lbs
.
getLBSDistance
(
'driving'
,
{
lat
,
lng
},
lbs_array
);
...
...
app/service/course/user.js
View file @
3e06ea3b
...
@@ -96,7 +96,7 @@ class UserService extends Service {
...
@@ -96,7 +96,7 @@ class UserService extends Service {
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
user_uuid
=
ctx
.
userUuid
;
const
user_uuid
=
ctx
.
userUuid
;
const
{
page
,
limit
}
=
input
;
const
{
page
,
limit
,
lat
,
lng
}
=
input
;
const
where
=
{
user_uuid
,
is_deleted
:
0
};
const
where
=
{
user_uuid
,
is_deleted
:
0
};
const
collect_institution_rows
=
await
ctx
.
classModel
.
CourseUserCollection
.
list
({
page
,
limit
,
where
});
const
collect_institution_rows
=
await
ctx
.
classModel
.
CourseUserCollection
.
list
({
page
,
limit
,
where
});
const
institution_ids
=
R
.
pluck
(
'institution_id'
,
collect_institution_rows
.
rows
);
const
institution_ids
=
R
.
pluck
(
'institution_id'
,
collect_institution_rows
.
rows
);
...
@@ -107,7 +107,7 @@ class UserService extends Service {
...
@@ -107,7 +107,7 @@ class UserService extends Service {
const
attributes
=
[
'id'
,
'name'
,
'type'
,
'establishment_time'
,
'class_type'
,
'teacher_count'
,
'teacher_experience'
,
'corner'
,
'min_age'
,
'max_age'
,
'price'
,
'characteristic'
,];
const
attributes
=
[
'id'
,
'name'
,
'type'
,
'establishment_time'
,
'class_type'
,
'teacher_count'
,
'teacher_experience'
,
'corner'
,
'min_age'
,
'max_age'
,
'price'
,
'characteristic'
,];
const
institutions
=
await
ctx
.
classModel
.
CourseInstitution
.
findAll
({
attributes
,
include
,
where
:
{
id
:
{
$in
:
institution_ids
},
status
:
1
,
is_deleted
:
0
}
});
const
institutions
=
await
ctx
.
classModel
.
CourseInstitution
.
findAll
({
attributes
,
include
,
where
:
{
id
:
{
$in
:
institution_ids
},
status
:
1
,
is_deleted
:
0
}
});
const
institution_area_list
=
await
ctx
.
service
.
course
.
institution
.
getInstitutionAreaList
(
institutions
);
const
institution_area_list
=
await
ctx
.
service
.
course
.
institution
.
getInstitutionAreaList
(
institutions
);
const
area_lbs
=
await
ctx
.
service
.
course
.
institution
.
computeDistance
(
institution_area_list
);
//计算距离
const
area_lbs
=
await
ctx
.
service
.
course
.
institution
.
computeDistance
(
institution_area_list
,
{
lat
,
lng
}
);
//计算距离
const
institution_areas
=
await
ctx
.
service
.
course
.
institution
.
findShortestDistanceAreas
(
institution_area_list
,
area_lbs
);
const
institution_areas
=
await
ctx
.
service
.
course
.
institution
.
findShortestDistanceAreas
(
institution_area_list
,
area_lbs
);
const
ret
=
await
ctx
.
service
.
course
.
institution
.
formatInstitutions
(
institution_areas
);
const
ret
=
await
ctx
.
service
.
course
.
institution
.
formatInstitutions
(
institution_areas
);
...
...
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