Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
77eeacdb
Commit
77eeacdb
authored
Sep 15, 2021
by
suntengda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tuancan' into test
parents
34d4b89f
02f9de51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
TakePlaceService.php
application/services/marketing/TakePlaceService.php
+14
-1
No files found.
application/services/marketing/TakePlaceService.php
View file @
77eeacdb
...
...
@@ -131,6 +131,19 @@ class TakePlaceService
$page
=
$params
[
'page'
]
??
1
;
$limit
=
$params
[
'limit'
]
??
20
;
//兼容客户端传递NaN字符串的问题
if
(
!
empty
(
$longitude
)
&&
!
is_numeric
(
$longitude
))
{
$longitude
=
''
;
}
if
(
!
empty
(
$latitude
)
&&
!
is_numeric
(
$latitude
))
{
$latitude
=
''
;
}
//经纬度小程序调用时前后端都是反的,客户端按正确顺序传,程序把参数反过来,小程序目前来不及改,暂时先按反着的来
//临时交换客户端传过来的经纬度的值 @todo 后期前后端一起修正传参后去掉此逻辑(注意小程序版本控制)
if
(
isset
(
$params
[
'app_id'
])
&&
$params
[
'app_id'
]
==
'merchant-c'
)
{
list
(
$longitude
,
$latitude
)
=
[
$latitude
,
$longitude
];
}
$offset
=
(
$page
-
1
)
*
$limit
;
$res
=
[
'list'
=>
[],
'total'
=>
0
];
...
...
@@ -190,7 +203,7 @@ class TakePlaceService
if
(
!
empty
(
$list
)
&&
is_array
(
$list
))
{
foreach
(
$list
as
&
$item
)
{
if
(
$item
[
'longitude'
]
&&
$item
[
'latitude'
])
{
$item
[
'distance'
]
=
Geo
::
geoDistance
(
$lat
,
$lng
,
$item
[
'l
ongitude'
],
$item
[
'lat
itude'
],
true
);
$item
[
'distance'
]
=
Geo
::
geoDistance
(
$lat
,
$lng
,
$item
[
'l
atitude'
],
$item
[
'long
itude'
],
true
);
$sort
[]
=
$item
[
'distance'
];
}
else
{
$item
[
'distance'
]
=
''
;
...
...
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