|
@@ -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})
|
|
|
- ),1) distance
|
|
|
+ )) 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})
|
|
|
- ),1) distance
|
|
|
+ )) 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})
|
|
|
- ),1) distance
|
|
|
+ )) distance
|
|
|
from `merchant` mt
|
|
|
<if test="categoryId != null or (keyword != null and !keyword.isEmpty())">
|
|
|
left join `goods` gs on gs.merchant_id = mt.id
|
|
@@ -75,7 +75,7 @@
|
|
|
mt.create_time as createTime,
|
|
|
round(st_distance_sphere(
|
|
|
point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
|
- ), 1) distance
|
|
|
+ )) distance
|
|
|
from `merchant` mt
|
|
|
where mt.id = #{id} and mt.region = #{param.region}
|
|
|
</select>
|