|
@@ -12,7 +12,7 @@
|
|
|
select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,
|
|
|
round(st_distance_sphere(
|
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
|
- )) distance
|
|
|
+ ),1) distance
|
|
|
from `merchant` mt
|
|
|
where mt.region = #{param.region} and mt.status = 'ONLINE'
|
|
|
order by distance asc limit #{size}
|
|
@@ -22,7 +22,7 @@
|
|
|
select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,
|
|
|
round(st_distance_sphere(
|
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
|
- )) distance
|
|
|
+ ),1) distance
|
|
|
from `merchant` mt
|
|
|
where mt.region = #{param.region} and mt.status = 'ONLINE' and mt.recommend = 1
|
|
|
order by distance asc limit #{size}
|
|
@@ -32,7 +32,7 @@
|
|
|
select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,
|
|
|
round(st_distance_sphere(
|
|
|
point(mt.longitude, mt.latitude), point(#{longitude}, #{latitude})
|
|
|
- )) distance
|
|
|
+ ),1) distance
|
|
|
from `merchant` mt
|
|
|
<if test="categoryId != null or (keyword != null and !keyword.isEmpty())">
|
|
|
left join `goods` gs on gs.merchant_id = mt.id
|