@andrewwang
2017-02-14T16:57:40.000000Z
字数 567
阅读 616
技术
分布式缓存,分表分库
SELECT DISTINCT
t1.id,
t1.latitude,
t1.longitude,
t1.address,
t2.id AS servantId,
t2. NAME,
t2.sex,
t2.head_image,
getDistance (
31.23551214170 ,121.39876467142,
t1.latitude,
t1.longitude
) AS distance
FROM
work_work_store t1,
work_servant t2,
work_servant_work t3,
mall_sale_item_sku t4
WHERE
t1. STATUS =1
AND t1.is_default =1
AND t2. STATUS =1
AND t2.audit =4
AND t2.is_npc =0
AND t2.service_status ='online'
AND t2.id = t1.servant_id
AND t4.item_id =111112
AND t4.id = t3.item_sku_id
AND t3.servant_id = t2.id
AND getDistance (
31.23551214170 ,121.39876467142,
t1.latitude,
t1.longitude
) < 3
ORDER BY
distance ASC
LIMIT 10